change value of threshold in photogate class
authorniyatisriram <niyatisriram@gmail.com>
Wed, 17 Feb 2016 18:55:02 +0000 (10:55 -0800)
committerniyatisriram <niyatisriram@gmail.com>
Wed, 17 Feb 2016 18:55:02 +0000 (10:55 -0800)
src/org/usfirst/frc/team3501/robot/sensors/Photogate.java

index ddb5247217eb9ec27e43d3acd2d530300d3e6ad4..b1d003988e908fd038a1d1c27453014612f0602e 100644 (file)
@@ -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;