From: niyatisriram Date: Wed, 17 Feb 2016 18:55:02 +0000 (-0800) Subject: change value of threshold in photogate class X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=ef0cfbf9f32f35f07433b6bba3c0d0f9501f2635 change value of threshold in photogate class --- diff --git a/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java b/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java index ddb52472..b1d00398 100644 --- a/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java +++ b/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java @@ -15,7 +15,7 @@ import edu.wpi.first.wpilibj.AnalogInput; */ public class Photogate extends AnalogInput { - private double threshold; + private double threshold = 1.8; /*** * The constructor inputs the channel of the transistor and the threshold @@ -35,7 +35,7 @@ public class Photogate extends AnalogInput { * @return whether the ball is present or not */ public boolean isBallPresent() { - if (this.getValue() > threshold) + if (this.getVoltage() > threshold) return true; else return false;