edit continuous commands
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / intake / ReverseIntakeContinuous.java
index b84a1920b9cbf90a3509c108522fb1e8a1169fb5..f44631661476e7d309e58abdf663b0d5b75c1fdd 100644 (file)
@@ -7,7 +7,8 @@ import edu.wpi.first.wpilibj.command.Command;
 /**
  * Reverses the intake until the button triggering this command is released
  *
- * pre-condition: button is pressed
+ * pre-condition: This command must be run by a button in OI with
+ * button.whileHeld(...).
  */
 public class ReverseIntakeContinuous extends Command {
 
@@ -23,6 +24,7 @@ public class ReverseIntakeContinuous extends Command {
   // Called repeatedly when this Command is scheduled to run
   @Override
   protected void execute() {
+    Robot.getIntake().runReverseIntake();
   }
 
   // Make this return true when this Command no longer needs to run execute()
@@ -34,11 +36,13 @@ public class ReverseIntakeContinuous extends Command {
   // Called once after isFinished returns true
   @Override
   protected void end() {
+    Robot.getIntake().stopIntake();
   }
 
   // Called when another command which requires one or more of the same
   // subsystems is scheduled to run
   @Override
   protected void interrupted() {
+    end();
   }
 }