add end method code to initialize method
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / intake / StopIntake.java
index 54e8a603b5aff28bb1b23e8871f921d3b62a0c6d..92b8b82824986acd0b25a5810716e3dc6e179fff 100644 (file)
@@ -1,6 +1,6 @@
 package org.usfirst.frc.team3501.robot.commands.intake;
 
-import org.usfirst.frc.team3501.robot.subsystems.Intake;
+import org.usfirst.frc.team3501.robot.Robot;
 
 import edu.wpi.first.wpilibj.command.Command;
 
@@ -12,12 +12,13 @@ import edu.wpi.first.wpilibj.command.Command;
  */
 public class StopIntake extends Command {
   public StopIntake() {
-
+    requires(Robot.getIntake());
   }
 
   // Called just before this Command runs the first time
   @Override
   protected void initialize() {
+    Robot.getIntake().stopIntake();
   }
 
   // Called repeatedly when this Command is scheduled to run
@@ -28,7 +29,6 @@ public class StopIntake extends Command {
   // Called once after isFinished returns true
   @Override
   protected void end() {
-    Intake.intake.setSpeed(0);
   }
 
   // Called when another command which requires one or more of the same
@@ -40,8 +40,7 @@ public class StopIntake extends Command {
 
   @Override
   protected boolean isFinished() {
-    // TODO Auto-generated method stub
-    return false;
+    return true;
   }
 
 }