competition fixes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / shooter / StopFlyWheel.java
index 68c6cf0ce4a3e1ce17563b5969ee592cdb73f010..0d1bbe83cf212d0022ccba2f3a54091351b1b85e 100644 (file)
@@ -1,38 +1,53 @@
 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 stops the fly wheel. Do not call unless the trigger button has
+ * been released.
+ *
+ *
+ * @author Shaina
+ */
 public class StopFlyWheel extends Command {
-
-       /**
-        * Stops fly wheel
-        */
-
-       // Called just before this Command runs the first time
-       @Override
-       protected void initialize() {
-       }
-
-       // Called repeatedly when this Command is scheduled to run
-       @Override
-       protected void execute() {
-       }
-
-       // Called once after isFinished returns true
-       @Override
-       protected void end() {
-       }
-
-       // Called when another command which requires one or more of the same
-       // subsystems is scheduled to run
-       @Override
-       protected void interrupted() {
-       }
-
-       @Override
-       protected boolean isFinished() {
-               // TODO Auto-generated method stub
-               return false;
-       }
+  private Shooter shooter = Robot.getShooter();
+
+  /**
+   * This command stops the fly wheel.
+   */
+  public StopFlyWheel() {
+    requires(shooter);
+  }
+
+  // Called just before this Command runs the first time
+  @Override
+  protected void initialize() {
+  }
+
+  // Called repeatedly when this Command is scheduled to run
+  @Override
+  protected void execute() {
+  }
+
+  // Called once after isFinished returns true
+  @Override
+  protected void end() {
+    Robot.getShooter().stopFlyWheel();
+  }
+
+  // Called when another command which requires one or more of the same
+  // subsystems is scheduled to run
+  @Override
+  protected void interrupted() {
+    end();
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return true;
+  }
 
 }