competition fixes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / subsystems / Shooter.java
index bf743b1a3195139d8ec59c73f4d5f713087458e3..5711b2696ca632e6e790920f5a97057a2660f34b 100644 (file)
@@ -19,8 +19,9 @@ public class Shooter extends Subsystem {
 
   private static final double RPM_THRESHOLD = 10;
   private static final double DEFAULT_INDEXING_MOTOR_VALUE = 0.75;
-  private static final double DEFAULT_SHOOTING_SPEED = 2800; // rpm
-  private static final double SHOOTING_SPEED_INCREMENT = 50;
+  private static final double REVERSE_FLYWHEEL_MOTOR_VALUE = -0.75;
+  private static final double DEFAULT_SHOOTING_SPEED = 2875; // rpm
+  private static final double SHOOTING_SPEED_INCREMENT = 25;
 
   private double targetShootingSpeed = DEFAULT_SHOOTING_SPEED;
   private double currentShooterMotorValue = 0;
@@ -52,7 +53,7 @@ public class Shooter extends Subsystem {
    *          motor value from -1 to 1(fastest forward)
    */
   public void setFlyWheelMotorVal(double val) {
-    val = MathLib.restrictToRange(val, 0.0, 1.0);
+    val = MathLib.restrictToRange(val, -1.0, 1.0);
     flyWheel1.set(val);
     flyWheel2.set(val);
   }
@@ -140,4 +141,8 @@ public class Shooter extends Subsystem {
     this.wheelController.setSetPoint(this.targetShootingSpeed);
     this.currentShooterMotorValue = 0;
   }
+
+  public void reverseFlyWheel() {
+    this.setFlyWheelMotorVal(shooter.REVERSE_FLYWHEEL_MOTOR_VALUE);
+  }
 }