X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FShooter.java;h=6e0c7acfb443a9106e46ed27d0c40e985732ebf4;hb=68e554b243aad0de65f60658ff21ec893119d526;hp=0d9187a441b6a734e4fc0e61ef3d848a7034d16f;hpb=c63ba9b9649deb7b4441f318a578c638cb26ebb9;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index 0d9187a4..6e0c7acf 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -26,6 +26,7 @@ public class Shooter extends Subsystem { private Encoder encoder; private Lidar lidar; private Photogate photogate; + private boolean usePhotoGate; public Shooter() { shooter = new CANTalon(Constants.Shooter.PORT); @@ -38,6 +39,7 @@ public class Shooter extends Subsystem { encoder = new Encoder(Constants.Shooter.ENCODER_PORT_A, Constants.Shooter.ENCODER_PORT_B, false, EncodingType.k4X); + usePhotoGate = true; } /*** @@ -49,7 +51,12 @@ public class Shooter extends Subsystem { */ public boolean isBallInside() { - return photogate.isBallPresent(); + + if (usePhotogate()) + return photogate.isBallPresent(); + else + return true; + } public void setSpeed(double speed) { @@ -113,6 +120,14 @@ public class Shooter extends Subsystem { return false; } + public boolean usePhotogate() { + return this.usePhotoGate; + } + + public void togglePhotoGate() { + this.usePhotoGate = !this.usePhotoGate; + } + @Override protected void initDefaultCommand() { }