From: Cindy Zhang Date: Sat, 4 Feb 2017 18:59:22 +0000 (-0800) Subject: create and implement reset shooting speed command X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=292b55d37ff914cf4f094b01b40f4389db29a200 create and implement reset shooting speed command --- 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(); + } +}