| 1 | package org.usfirst.frc.team3501.robot.commands.shooter; |
| 2 | |
| 3 | import org.usfirst.frc.team3501.robot.Robot; |
| 4 | import org.usfirst.frc.team3501.robot.subsystems.Shooter; |
| 5 | |
| 6 | import edu.wpi.first.wpilibj.command.Command; |
| 7 | |
| 8 | /** |
| 9 | * This command stops the fly wheel. Do not call unless the trigger button has |
| 10 | * been released. |
| 11 | * |
| 12 | * |
| 13 | * @author Shaina |
| 14 | */ |
| 15 | public class StopFlyWheel extends Command { |
| 16 | private Shooter shooter = Robot.getShooter(); |
| 17 | |
| 18 | /** |
| 19 | * This command stops the fly wheel. |
| 20 | */ |
| 21 | public StopFlyWheel() { |
| 22 | requires(shooter); |
| 23 | } |
| 24 | |
| 25 | // Called just before this Command runs the first time |
| 26 | @Override |
| 27 | protected void initialize() { |
| 28 | } |
| 29 | |
| 30 | // Called repeatedly when this Command is scheduled to run |
| 31 | @Override |
| 32 | protected void execute() { |
| 33 | } |
| 34 | |
| 35 | // Called once after isFinished returns true |
| 36 | @Override |
| 37 | protected void end() { |
| 38 | Robot.getShooter().stopFlyWheel(); |
| 39 | } |
| 40 | |
| 41 | // Called when another command which requires one or more of the same |
| 42 | // subsystems is scheduled to run |
| 43 | @Override |
| 44 | protected void interrupted() { |
| 45 | end(); |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | protected boolean isFinished() { |
| 50 | return true; |
| 51 | } |
| 52 | |
| 53 | } |