fix indexing piston code
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / shooter / RunIndexWheelContinuous.java
index f958be7fa4788e067e93b225680d56045e08c532..1428387ff4eafbaaa4b404524554bd922931aee0 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;
 
@@ -38,6 +39,14 @@ public class RunIndexWheelContinuous extends Command {
   // Called repeatedly when this Command is scheduled to run
   @Override
   protected void execute() {
+    if (timeSinceInitialized() % 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.setIndexWheelMotorVal(shooter.DEFAULT_INDEXING_SPEED);