809609c9 |
1 | package org.usfirst.frc.team3501.robot.commands.shooter; |
2 | |
210ebccb |
3 | import org.usfirst.frc.team3501.robot.Robot; |
4 | |
809609c9 |
5 | import edu.wpi.first.wpilibj.command.Command; |
6 | |
7 | /** |
89a76b33 |
8 | * This command will run the index wheel motor continuously until the button |
9 | * triggering it is released. |
357feb5c |
10 | * |
973f0ac4 |
11 | * pre-condition: This command must be run by a button in OI with |
12 | * button.whileHeld(...). |
13 | * |
27d2386f |
14 | * @author Shaina |
809609c9 |
15 | */ |
16 | public class RunIndexWheelContinuous extends Command { |
a2a99ce1 |
17 | private double motorVal; |
4f2fa45c |
18 | |
b7ef589a |
19 | /** |
20 | * See JavaDoc comment in class for details |
21 | * |
22 | * @param motorVal |
23 | * value range from -1 to 1 |
24 | */ |
a2a99ce1 |
25 | public RunIndexWheelContinuous(double motorVal) { |
26 | this.motorVal = motorVal; |
4f2fa45c |
27 | } |
28 | |
29 | // Called just before this Command runs the first time |
30 | @Override |
31 | protected void initialize() { |
210ebccb |
32 | Robot.getShooter().setIndexWheelMotorVal(motorVal); |
4f2fa45c |
33 | } |
34 | |
35 | // Called repeatedly when this Command is scheduled to run |
36 | @Override |
37 | protected void execute() { |
38 | } |
39 | |
40 | // Called once after isFinished returns true |
41 | @Override |
42 | protected void end() { |
43 | } |
44 | |
45 | // Called when another command which requires one or more of the same |
46 | // subsystems is scheduled to run |
47 | @Override |
48 | protected void interrupted() { |
210ebccb |
49 | end(); |
4f2fa45c |
50 | } |
51 | |
52 | @Override |
53 | protected boolean isFinished() { |
7b246392 |
54 | return false; |
4f2fa45c |
55 | } |
809609c9 |
56 | |
57 | } |