Fix code changes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / shooter / ToggleIndexerPiston.java
1 package org.usfirst.frc.team3501.robot.commands.shooter;
2
3 import org.usfirst.frc.team3501.robot.Constants;
4 import org.usfirst.frc.team3501.robot.Robot;
5 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
6
7 import edu.wpi.first.wpilibj.command.Command;
8
9 public class ToggleIndexerPiston extends Command {
10 private Shooter shooter = Robot.getShooter();
11
12 /**
13 * See JavaDoc comment in class for details
14 *
15 * @param motorVal
16 * value range from -1 to 1
17 */
18 public ToggleIndexerPiston() {
19 requires(shooter);
20 }
21
22 // Called just before this Command runs the first time
23 @Override
24 protected void initialize() {
25 }
26
27 // Called repeatedly when this Command is scheduled to run
28 @Override
29 protected void execute() {
30 if (shooter.getPistonValue() == Constants.Shooter.LOW_GEAR) {
31 shooter.setHighGear();
32 } else {
33 shooter.setLowGear();
34 }
35
36 }
37
38 // Called once after isFinished returns true
39 @Override
40 protected void end() {
41 }
42
43 // Called when another command which requires one or more of the same
44 // subsystems is scheduled to run
45 @Override
46 protected void interrupted() {
47 end();
48 }
49
50 @Override
51 protected boolean isFinished() {
52 return true;
53
54 }
55
56 }