Add comments to call commands with whileHeld in oi
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / ToggleBallRollerExpel.java
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
7 public class ToggleBallRollerExpel extends Command {
8
9 // Must be called with whileHeld in oi
10 public ToggleBallRollerExpel() {
11 requires(Robot.intakeArm);
12 }
13
14 @Override
15 protected void initialize() {
16 if (Robot.intakeArm.areRollersRolling())
17 Robot.intakeArm.stopRollers();
18 else
19 Robot.intakeArm.outputBall();
20 }
21
22 @Override
23 protected void execute() {
24
25 }
26
27 @Override
28 protected boolean isFinished() {
29 return true;
30 }
31
32 @Override
33 protected void end() {
34 Robot.intakeArm.stopRollers();
35 }
36
37 @Override
38 protected void interrupted() {
39 end();
40 }
41 }