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 | /** | |
de8c65d3 SG |
8 | * This command will run the winch motor continuously until the button |
9 | * triggering it is released | |
9738295a SG |
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() { | |
5be898b7 | 23 | Robot.getClimber().setMotorValue(motorVal); |
cf086549 | 24 | |
9738295a SG |
25 | } |
26 | ||
27 | @Override | |
28 | protected void execute() { | |
29 | ||
30 | } | |
31 | ||
32 | @Override | |
33 | protected boolean isFinished() { | |
de8c65d3 | 34 | return !Robot.getOI().toggleWinch.get(); |
9738295a SG |
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 | } |