Commit | Line | Data |
---|---|---|
0d4d5dcb LM |
1 | package org.usfirst.frc.team3501.robot.commands; |
2 | ||
3 | import org.usfirst.frc.team3501.robot.Robot; | |
4 | ||
5 | import edu.wpi.first.wpilibj.command.Command; | |
6 | ||
5a3fcb1c | 7 | /*** |
a7160a69 LM |
8 | * This command will run the winch motor continuously until the button |
9 | * tirggering it is released. | |
5a3fcb1c LM |
10 | * |
11 | * pre-condition: This command must be run by a button in OI with method | |
a7160a69 | 12 | * whileHeld(). The robot must be attached to the tower rung. |
5a3fcb1c LM |
13 | * |
14 | * post-condition: winch motor set to a specified speed. | |
15 | * | |
d4649cd7 | 16 | * @author Lauren |
5a3fcb1c LM |
17 | * |
18 | */ | |
19 | ||
a7160a69 | 20 | public class RunWinchContinuous extends Command { |
a7160a69 | 21 | private double winchUpSpeed; |
0d4d5dcb | 22 | |
a7160a69 | 23 | public RunWinchContinuous(double speed) { |
0ecbf4af | 24 | requires(Robot.scaler); |
0d4d5dcb | 25 | winchUpSpeed = speed; |
0d4d5dcb LM |
26 | } |
27 | ||
28 | @Override | |
29 | protected void initialize() { | |
30 | Robot.scaler.runWinch(winchUpSpeed); | |
31 | } | |
32 | ||
33 | @Override | |
34 | protected void execute() { | |
35 | } | |
36 | ||
37 | @Override | |
38 | protected boolean isFinished() { | |
39 | return true; | |
40 | } | |
41 | ||
42 | @Override | |
43 | protected void end() { | |
694c9fc9 | 44 | Robot.scaler.stopWinch(); |
0d4d5dcb LM |
45 | } |
46 | ||
47 | @Override | |
48 | protected void interrupted() { | |
a7160a69 | 49 | end(); |
0d4d5dcb LM |
50 | } |
51 | } |