Commit | Line | Data |
---|---|---|
ab918627 SC |
1 | package org.usfirst.frc.team3501.robot.commands; |
2 | ||
bcfe756d | 3 | import org.usfirst.frc.team3501.robot.Robot; |
ab918627 | 4 | |
bcfe756d SC |
5 | import edu.wpi.first.wpilibj.command.Command; |
6 | ||
9dd13c38 SC |
7 | /*** |
8 | * This command is intended to be run from OI using button.whileHeld(...). | |
9 | * It raises the defenseArm continually while the button is being held down. | |
10 | * | |
11 | * @author shaina | |
12 | */ | |
1269b39b | 13 | public class RaiseDefenseArmContinuous extends Command { |
bcfe756d SC |
14 | |
15 | private double speed; | |
16 | ||
1269b39b | 17 | public RaiseDefenseArmContinuous(double speed) { |
bcfe756d SC |
18 | requires(Robot.defenseArm); |
19 | this.speed = speed; | |
20 | } | |
21 | ||
22 | @Override | |
23 | protected void initialize() { | |
24 | Robot.defenseArm.setArmSpeed(speed); | |
25 | } | |
26 | ||
27 | @Override | |
28 | protected void execute() { | |
29 | } | |
30 | ||
31 | @Override | |
32 | protected boolean isFinished() { | |
47ef33b1 | 33 | return true; |
bcfe756d SC |
34 | } |
35 | ||
36 | @Override | |
37 | protected void end() { | |
38 | Robot.defenseArm.setArmSpeed(0); | |
39 | } | |
40 | ||
41 | @Override | |
42 | protected void interrupted() { | |
43 | end(); | |
44 | } | |
ab918627 | 45 | } |