change execute method, fill in end method
authorArunima DIvya <adivya822@student.fuhsd.org>
Wed, 25 Jan 2017 04:38:00 +0000 (20:38 -0800)
committerArunima DIvya <adivya822@student.fuhsd.org>
Thu, 26 Jan 2017 04:14:07 +0000 (20:14 -0800)
src/org/usfirst/frc/team3501/robot/commands/intake/RunIntake.java

index 5452073515b0fb7d719b1d2df15200d682595dcf..3b619ceb5a9a9f6ae006e679becc7e5188338db3 100644 (file)
@@ -15,6 +15,10 @@ public class RunIntake extends Command {
   private double timeToMove;
   public Timer timer;
 
+  /**
+   *
+   * @param timeToMove
+   */
   public RunIntake(double timeToMove) {
     requires(Robot.getIntake());
     timer = new Timer();
@@ -35,12 +39,14 @@ public class RunIntake extends Command {
   // Called repeatedly when this Command is scheduled to run
   @Override
   protected void execute() {
-    Robot.getIntake().setSpeed(Robot.getIntake().INTAKE_SPEED);
+    Robot.getIntake().runIntake();
   }
 
   // Called once after isFinished returns true
   @Override
   protected void end() {
+    timer.stop();
+    Robot.getIntake().stopIntake();
   }
 
   // Called when another command which requires one or more of the same