edit continuous commands
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinchContinuous.java
1 package org.usfirst.frc.team3501.robot.commands.climber;
2
3 import org.usfirst.frc.team3501.robot.Robot;
4
5 import edu.wpi.first.wpilibj.command.Command;
6
7 /**
8 * This command runs the drive train motors (which runs the winch) continuously
9 * at a specified speed until the button triggering it is released
10 *
11 * pre-condition: This command must be run by a button in OI with
12 * button.whileHeld(...). The robot must be attached to the rope.
13 *
14 * post-condition: Drive train motors set to a specified speed.
15 *
16 * @author shivanighanta
17 *
18 */
19 public class RunWinchContinuous extends Command {
20 private double motorVal;
21
22 /**
23 * See JavaDoc comment in class for details
24 *
25 * @param motorVal
26 * value range is from -1 to 1
27 */
28 public RunWinchContinuous(double motorVal) {
29 requires(Robot.getDriveTrain());
30 this.motorVal = motorVal;
31 }
32
33 @Override
34 protected void initialize() {
35 Robot.getDriveTrain().setMotorValues(motorVal, motorVal);
36 }
37
38 @Override
39 protected void execute() {
40
41 }
42
43 @Override
44 protected boolean isFinished() {
45 return false;
46 }
47
48 @Override
49 protected void end() {
50
51 }
52
53 @Override
54 protected void interrupted() {
55 end();
56 }
57 }