competition fixes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / subsystems / Intake.java
index 17ff8fe22413a4e1507644b89a42bc2d4eb203b2..b6c82d484f5f56b03dac38dd6332496972937910 100644 (file)
@@ -1,6 +1,7 @@
 package org.usfirst.frc.team3501.robot.subsystems;
 
 import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.MathLib;
 
 import com.ctre.CANTalon;
 
@@ -12,8 +13,8 @@ import edu.wpi.first.wpilibj.command.Subsystem;
 public class Intake extends Subsystem {
   private static Intake intake = null;
   private CANTalon intakeWheel;
-  public static final double INTAKE_SPEED = 0;
-  public static final double REVERSE_SPEED = 0;
+  public static final double INTAKE_SPEED = 1;
+  public static final double REVERSE_SPEED = -1;
 
   public Intake() {
     intakeWheel = new CANTalon(Constants.Intake.INTAKE_ROLLER_PORT);
@@ -43,7 +44,8 @@ public class Intake extends Subsystem {
    * @param speed
    *          from -1 to 1
    */
-  private void setSpeed(double speed) {
+  public void setSpeed(double speed) {
+    speed = MathLib.restrictToRange(speed, -1.0, 1.0);
     intakeWheel.set(speed);
   }
 
@@ -66,7 +68,7 @@ public class Intake extends Subsystem {
    * the robot. Reverses intake wheel by setting wheel speed to reverse speed.
    *
    */
-  public void reverseIntake() {
+  public void runReverseIntake() {
     setSpeed(REVERSE_SPEED);
   }