Commit | Line | Data |
---|---|---|
9738295a SG |
1 | package org.usfirst.frc.team3501.robot.commands.climber; |
2 | ||
a04ce2ff SG |
3 | import org.usfirst.frc.team3501.robot.Robot; |
4 | ||
9738295a SG |
5 | import edu.wpi.first.wpilibj.command.Command; |
6 | ||
7 | /** | |
8 | * Runs the winch continuously at a given motor value | |
9 | * | |
10 | * @author shivanighanta | |
11 | * | |
12 | */ | |
13 | public class RunWinchContinuous extends Command { | |
14 | private double motorVal; | |
15 | ||
16 | public RunWinchContinuous(double motorVal) { | |
a04ce2ff | 17 | requires(Robot.getClimber()); |
9738295a SG |
18 | this.motorVal = motorVal; |
19 | } | |
20 | ||
21 | @Override | |
22 | protected void initialize() { | |
cf086549 SG |
23 | Robot.getClimber().setMotorValues(motorVal); |
24 | ||
9738295a SG |
25 | } |
26 | ||
27 | @Override | |
28 | protected void execute() { | |
29 | ||
30 | } | |
31 | ||
32 | @Override | |
33 | protected boolean isFinished() { | |
34 | return false; | |
35 | } | |
36 | ||
37 | @Override | |
38 | protected void end() { | |
a04ce2ff | 39 | Robot.getClimber().stop(); |
9738295a SG |
40 | } |
41 | ||
42 | @Override | |
43 | protected void interrupted() { | |
a04ce2ff | 44 | end(); |
9738295a SG |
45 | } |
46 | } |