competition fixes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / subsystems / Shooter.java
index adfdb341862f933a03094392848cdfe80ec37328..5711b2696ca632e6e790920f5a97057a2660f34b 100644 (file)
@@ -18,8 +18,9 @@ public class Shooter extends Subsystem {
   private PIDController wheelController;
 
   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 DEFAULT_INDEXING_MOTOR_VALUE = 0.75;
+  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;
@@ -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);
+  }
 }