Add buttons to OI class
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / shooter / RunFlyWheelContinuous.java
index a5e8501f1a5b50b137221d1b8fd4d44827e52ee2..cc07893019111c9e88f0115784de98d079981862 100644 (file)
@@ -5,9 +5,12 @@ import org.usfirst.frc.team3501.robot.Robot;
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
- * This command will run the fly wheel motor continuously until the button
+ * This command runs the fly wheel continuously when OI button managing fly
+ * wheel is pressed. The command will run the fly wheel motor until the button
  * triggering it is released.
  *
+ * Should only be run from the operator interface.
+ *
  * pre-condition: This command must be run by a button in OI, with
  * button.whileHeld(...).
  *
@@ -40,7 +43,6 @@ public class RunFlyWheelContinuous extends Command {
   // Called once after isFinished returns true
   @Override
   protected void end() {
-    Robot.getShooter().stopFlyWheel();
   }
 
   // Called when another command which requires one or more of the same
@@ -52,8 +54,7 @@ public class RunFlyWheelContinuous extends Command {
 
   @Override
   protected boolean isFinished() {
-    return false;
-
+    return !Robot.getOI().toggleFlyWheel.get();
   }
 
 }