rename filed from Toggle to Continuous
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / BallRollerIntakeContinuous.java
diff --git a/src/org/usfirst/frc/team3501/robot/commands/BallRollerIntakeContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/BallRollerIntakeContinuous.java
new file mode 100644 (file)
index 0000000..f8c3ffd
--- /dev/null
@@ -0,0 +1,49 @@
+package org.usfirst.frc.team3501.robot.commands;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will continually roll the rollers of the intake arm in the
+ * inwards direction and stop the rollers once the command is canceled.
+ *
+ * pre-condition: This command must be called by a button with the method
+ * .whileHeld() in OI
+ *
+ * @author Lauren and Niyati
+ *
+ */
+
+public class BallRollerIntakeContinuous extends Command {
+
+  public BallRollerIntakeContinuous() {
+    requires(Robot.intakeArm);
+  }
+
+  @Override
+  protected void initialize() {
+    Robot.intakeArm.intakeBall();
+  }
+
+  @Override
+  protected void execute() {
+
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return true;
+  }
+
+  @Override
+  protected void end() {
+    Robot.intakeArm.stopRollers();
+  }
+
+  @Override
+  protected void interrupted() {
+    end();
+  }
+
+}