create and implement reset shooting speed command
authorCindy Zhang <cindyzyx9@gmail.com>
Sat, 4 Feb 2017 18:59:22 +0000 (10:59 -0800)
committerCindy Zhang <cindyzyx9@gmail.com>
Sat, 4 Feb 2017 19:02:25 +0000 (11:02 -0800)
src/org/usfirst/frc/team3501/robot/commands/shooter/ResetShootingSpeed.java [new file with mode: 0644]

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 (file)
index 0000000..7a2f950
--- /dev/null
@@ -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();
+  }
+}