| 1 | package org.usfirst.frc3501.RiceCatRobot.commands; |
| 2 | |
| 3 | import org.usfirst.frc3501.RiceCatRobot.robot.Robot; |
| 4 | |
| 5 | import edu.wpi.first.wpilibj.command.Command; |
| 6 | |
| 7 | /** |
| 8 | * |
| 9 | */ |
| 10 | public class ToggleCompressor extends Command { |
| 11 | |
| 12 | public ToggleCompressor() { |
| 13 | } |
| 14 | |
| 15 | // Called just before this Command runs the first time |
| 16 | protected void initialize() { |
| 17 | } |
| 18 | |
| 19 | // Called repeatedly when this Command is scheduled to run |
| 20 | protected void execute() { |
| 21 | if (Robot.compressor.enabled()) { |
| 22 | Robot.compressor.stop(); |
| 23 | } else { |
| 24 | Robot.compressor.start(); |
| 25 | } |
| 26 | |
| 27 | } |
| 28 | |
| 29 | // Make this return true when this Command no longer needs to run execute() |
| 30 | protected boolean isFinished() { |
| 31 | return true; |
| 32 | } |
| 33 | |
| 34 | // Called once after isFinished returns true |
| 35 | protected void end() { |
| 36 | |
| 37 | } |
| 38 | |
| 39 | // Called when another command which requires one or more of the same |
| 40 | // subsystems is scheduled to run |
| 41 | protected void interrupted() { |
| 42 | } |
| 43 | } |