Delete copies of methods, and change initialize code in runIntakeContinuous and runRe...
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / intake / ReverseIntakeContinuous.java
index bab630da953142a9e95034e66bec90d22e08b1cd..a75a4bb28b4b665596441e1da874f895876ef67c 100644 (file)
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands.intake;
 
+import org.usfirst.frc.team3501.robot.Robot;
+
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
@@ -9,9 +11,8 @@ import edu.wpi.first.wpilibj.command.Command;
  */
 public class ReverseIntakeContinuous extends Command {
 
-  public ReverseIntakeContinuous(double timeToMove) {
-    // Use requires() here to declare subsystem dependencies
-    // eg. requires(chassis);
+  public ReverseIntakeContinuous() {
+    requires(Robot.getIntake());
   }
 
   // Called just before this Command runs the first time
@@ -22,6 +23,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()
@@ -33,11 +35,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();
   }
 }