change isFinished method, add end statement to end method
authorArunima DIvya <adivya822@student.fuhsd.org>
Wed, 25 Jan 2017 04:39:19 +0000 (20:39 -0800)
committerArunima DIvya <adivya822@student.fuhsd.org>
Thu, 26 Jan 2017 04:14:08 +0000 (20:14 -0800)
src/org/usfirst/frc/team3501/robot/commands/intake/RunIntakeContinuous.java

index a7ba2297fc74a4493b761063d54f79a8c2245bb5..efcd4d77e32d9a98e56cfc3b9181272f45fc07ea 100644 (file)
@@ -1,7 +1,6 @@
 package org.usfirst.frc.team3501.robot.commands.intake;
 
 import org.usfirst.frc.team3501.robot.Robot;
-import org.usfirst.frc.team3501.robot.subsystems.Intake;
 
 import edu.wpi.first.wpilibj.command.Command;
 
@@ -10,6 +9,8 @@ import edu.wpi.first.wpilibj.command.Command;
  * Runs the intake continuously when button is pressed, and when button is not
  * pressed does not run.
  *
+ * Intended to be run inside a .whileHeld() call on a button in OI
+ *
  * @author Meeta
  *
  */
@@ -23,26 +24,25 @@ public class RunIntakeContinuous extends Command {
 
   @Override
   protected boolean isFinished() {
-    // TODO Auto-generated method stub
-    return true;
+    return false;
   }
 
   // Called just before this Command runs the first time
   @Override
   protected void initialize() {
-
+    Robot.getIntake().runIntake();
   }
 
   // Called repeatedly when this Command is scheduled to run
   @Override
   protected void execute() {
-    Robot.getIntake().setSpeed(Robot.getIntake().INTAKE_SPEED);
+
   }
 
   // Called once after isFinished returns true
   @Override
   protected void end() {
-    Intake.intake.setSpeed(0);
+    Robot.getIntake().stopIntake();
   }
 
   // Called when another command which requires one or more of the same