X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fintakearm%2FPhotogate.java;fp=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fintakearm%2FPhotogate.java;h=aff5fc2d623a2b2a6ee5a2003f49c34d34e87df8;hb=53b6c82dab184bcfa94e27f507e390e01d9ac476;hp=9e6c2e8b5f1c000c8dd4c6b19c3542d9dbe6cea0;hpb=e2c4d3a5b10fa513a4e4e654a756f2e84eda02d0;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/commands/intakearm/Photogate.java b/src/org/usfirst/frc/team3501/robot/commands/intakearm/Photogate.java index 9e6c2e8b..aff5fc2d 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/intakearm/Photogate.java +++ b/src/org/usfirst/frc/team3501/robot/commands/intakearm/Photogate.java @@ -13,6 +13,7 @@ import edu.wpi.first.wpilibj.AnalogInput; public class Photogate extends AnalogInput { private double threshold = 1.8; + static boolean ballState; /*** * The constructor inputs the channel of the transistor and the threshold @@ -26,6 +27,7 @@ public class Photogate extends AnalogInput { public Photogate() { super(0); this.threshold = threshold; + } /*** @@ -33,11 +35,17 @@ public class Photogate extends AnalogInput { * USE TO DECIDE WHEN OUTTAKE NEEDS TO HAPPEN FOR BALL TO BE SECURE */ public boolean isBallPresent() { - if (this.getVoltage() > threshold) + if (this.getVoltage() > threshold) { + ballState = true; return true; - else - return false; + } else + ballState = false; + return false; + + } + public static boolean ballState() { + return ballState; } /***