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