edit continuous commands
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / intake / ReverseIntakeContinuous.java
CommitLineData
f43a1c52
CZ
1package org.usfirst.frc.team3501.robot.commands.intake;
2
6486f405
AD
3import org.usfirst.frc.team3501.robot.Robot;
4
f43a1c52
CZ
5import edu.wpi.first.wpilibj.command.Command;
6
7/**
8 * Reverses the intake until the button triggering this command is released
9 *
2a9dabb1
CZ
10 * pre-condition: This command must be run by a button in OI with
11 * button.whileHeld(...).
f43a1c52
CZ
12 */
13public class ReverseIntakeContinuous extends Command {
14
6486f405
AD
15 public ReverseIntakeContinuous() {
16 requires(Robot.getIntake());
f43a1c52
CZ
17 }
18
19 // Called just before this Command runs the first time
20 @Override
21 protected void initialize() {
22 }
23
24 // Called repeatedly when this Command is scheduled to run
25 @Override
26 protected void execute() {
1755df31 27 Robot.getIntake().runReverseIntake();
f43a1c52
CZ
28 }
29
30 // Make this return true when this Command no longer needs to run execute()
31 @Override
32 protected boolean isFinished() {
33 return false;
34 }
35
36 // Called once after isFinished returns true
37 @Override
38 protected void end() {
5690f629 39 Robot.getIntake().stopIntake();
f43a1c52
CZ
40 }
41
42 // Called when another command which requires one or more of the same
43 // subsystems is scheduled to run
44 @Override
45 protected void interrupted() {
5690f629 46 end();
f43a1c52
CZ
47 }
48}