Add code to alternate pistons in runIndexWheelContinuous
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / shooter / RunIndexWheelContinuous.java
index 34c7e0b4edb4df3a35f671974ee5293d833782f9..31fda94b45258565c1682306f8c7ada60828c50b 100644 (file)
@@ -1,5 +1,6 @@
 package org.usfirst.frc.team3501.robot.commands.shooter;
 
+import org.usfirst.frc.team3501.robot.Constants;
 import org.usfirst.frc.team3501.robot.Robot;
 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
 
@@ -41,6 +42,14 @@ public class RunIndexWheelContinuous extends Command {
   // Called repeatedly when this Command is scheduled to run
   @Override
   protected void execute() {
+    if (t.get() % 1 == 0) {
+      if (Shooter.getShooter().getPistonValue() == Constants.Shooter.LOW_GEAR) {
+        Shooter.getShooter().setHighGear();
+      } else {
+        Shooter.getShooter().setLowGear();
+      }
+    }
+
     double shooterSpeed = shooter.getShooterRPM();
     if (shooterSpeed > 0)
       shooter.runIndexWheel();