add precondition and Timeout to Expel and Intake commands
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / LowerDefenseArmContinuous.java
CommitLineData
2982ae9e
SC
1package org.usfirst.frc.team3501.robot.commands;
2
3import org.usfirst.frc.team3501.robot.Robot;
4
5import edu.wpi.first.wpilibj.command.Command;
6
11b831a5
SC
7/***
8 * This command is intended to be run from OI using button.whileHeld(...).
9 * It lowers the defenseArm continually while the button is being held down.
10 *
11 * @author shaina
12 *
13 */
1269b39b 14public class LowerDefenseArmContinuous extends Command {
2982ae9e
SC
15
16 private double speed;
17
1269b39b 18 public LowerDefenseArmContinuous(double speed) {
2982ae9e
SC
19 requires(Robot.defenseArm);
20 this.speed = -speed;
21 }
22
23 @Override
24 protected void initialize() {
25 Robot.defenseArm.setArmSpeed(speed);
26 }
27
28 @Override
29 protected void execute() {
30 }
31
32 @Override
33 protected boolean isFinished() {
11b831a5 34 return true;
2982ae9e
SC
35 }
36
37 @Override
38 protected void end() {
39 Robot.defenseArm.setArmSpeed(0);
40 }
41
42 @Override
43 protected void interrupted() {
44 end();
45 }
46}