Edit comments
[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 will run the winch motor continuously until the button
9 * triggering it is released
10 *
11 * @author shivanighanta
12 *
13 */
14 public class RunWinchContinuous extends Command {
15 private double motorVal;
16
17 public RunWinchContinuous(double motorVal) {
18 this.motorVal = motorVal;
19 }
20
21 @Override
22 protected void initialize() {
23 Robot.getClimber().setMotorValue(motorVal);
24
25 }
26
27 @Override
28 protected void execute() {
29
30 }
31
32 @Override
33 protected boolean isFinished() {
34 return !Robot.getOI().toggleWinch.get();
35 }
36
37 @Override
38 protected void end() {
39 Robot.getClimber().stop();
40 }
41
42 @Override
43 protected void interrupted() {
44 end();
45 }
46 }