From 292b55d37ff914cf4f094b01b40f4389db29a200 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 4 Feb 2017 10:59:22 -0800 Subject: [PATCH] create and implement reset shooting speed command --- .../commands/shooter/ResetShootingSpeed.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/org/usfirst/frc/team3501/robot/commands/shooter/ResetShootingSpeed.java diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/ResetShootingSpeed.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/ResetShootingSpeed.java new file mode 100644 index 0000000..7a2f950 --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/ResetShootingSpeed.java @@ -0,0 +1,44 @@ +package org.usfirst.frc.team3501.robot.commands.shooter; + +import org.usfirst.frc.team3501.robot.Robot; +import org.usfirst.frc.team3501.robot.subsystems.Shooter; + +import edu.wpi.first.wpilibj.command.Command; + +/** + * This command resets the speed at which the flywheel runs to the default + * shooting speed + * + * post-condition: the shooting speed is reset + */ +public class ResetShootingSpeed extends Command { + private Shooter shooter = Robot.getShooter(); + + public ResetShootingSpeed() { + requires(shooter); + } + + @Override + protected void initialize() { + shooter.CURRENT_SHOOTING_SPEED = shooter.DEFAULT_SHOOTING_SPEED; + } + + @Override + protected void execute() { + } + + @Override + protected boolean isFinished() { + return true; + } + + @Override + protected void end() { + } + + @Override + + protected void interrupted() { + end(); + } +} -- 2.30.2