From ef0cfbf9f32f35f07433b6bba3c0d0f9501f2635 Mon Sep 17 00:00:00 2001 From: niyatisriram Date: Wed, 17 Feb 2016 10:55:02 -0800 Subject: [PATCH] change value of threshold in photogate class --- src/org/usfirst/frc/team3501/robot/sensors/Photogate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.30.2