fix errors
authorKevin Zhang <icestormf1@gmail.com>
Wed, 17 Feb 2016 20:42:56 +0000 (12:42 -0800)
committerKevin Zhang <icestormf1@gmail.com>
Wed, 17 Feb 2016 20:42:56 +0000 (12:42 -0800)
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java

index 91793d8aebd2546c6733f1cd05f98302d72a6ae5..ab5eb66ffe6831db965cb078366dc21798e6f556 100755 (executable)
@@ -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;
   }
 
   /***
@@ -52,7 +54,7 @@ public class Shooter extends Subsystem {
     if (usePhotogate())
       return photogate.isBallPresent();
     else
-      return false;
+      return true;
   }
 
   public void setSpeed(double speed) {
@@ -117,7 +119,11 @@ public class Shooter extends Subsystem {
   }
 
   public boolean usePhotogate() {
-    return true;
+    return this.usePhotoGate;
+  }
+
+  public void togglePhotoGate() {
+    this.usePhotoGate = !this.usePhotoGate;
   }
 
   @Override