move setmotorvalues to execute and set wheels to constant speeds
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / shooter / RunFlyWheelContinuous.java
CommitLineData
809609c9 1package org.usfirst.frc.team3501.robot.commands.shooter;
2
dbec800d 3import org.usfirst.frc.team3501.robot.Robot;
00f515a1 4import org.usfirst.frc.team3501.robot.subsystems.Shooter;
dbec800d 5
809609c9 6import edu.wpi.first.wpilibj.command.Command;
7
8/**
d4507ede 9 * This command runs the fly wheel continuously when OI button managing fly
10 * wheel is pressed. The command will run the fly wheel motor until the button
89a76b33 11 * triggering it is released.
b6e97560 12 *
d4507ede 13 * Should only be run from the operator interface.
14 *
973f0ac4 15 * pre-condition: This command must be run by a button in OI, with
16 * button.whileHeld(...).
357feb5c 17 *
973f0ac4 18 * @author Shaina
809609c9 19 */
20public class RunFlyWheelContinuous extends Command {
00f515a1 21 private Shooter shooter = Robot.getShooter();
55cbd9ba 22
b7ef589a 23 /**
24 * See JavaDoc comment in class for details
25 *
26 * @param motorVal
27 * value range from -1 to 1
28 */
00f515a1
CZ
29 public RunFlyWheelContinuous() {
30 requires(shooter);
55cbd9ba 31 }
32
33 // Called just before this Command runs the first time
34 @Override
35 protected void initialize() {
36 }
37
38 // Called repeatedly when this Command is scheduled to run
39 @Override
40 protected void execute() {
00f515a1 41 shooter.setFlyWheelMotorVal(shooter.CURRENT_SHOOTING_SPEED);
55cbd9ba 42 }
43
44 // Called once after isFinished returns true
45 @Override
46 protected void end() {
47 }
48
49 // Called when another command which requires one or more of the same
50 // subsystems is scheduled to run
51 @Override
52 protected void interrupted() {
89a76b33 53 end();
55cbd9ba 54 }
55
56 @Override
57 protected boolean isFinished() {
7099e02a 58 return !Robot.getOI().toggleFlyWheel.get();
55cbd9ba 59 }
809609c9 60
61}