package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.MathLib;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.CounterBase.EncodingType;
}
public void setSpeed(double speed) {
- if (speed > 1.0)
- shooter.set(1.0);
- else if (speed < -1.0)
- shooter.set(-1.0);
- else
- shooter.set(speed);
+ speed = MathLib.constrain(speed, -1, 1);
+ shooter.set(speed);
}
public void stop() {
}
// Punch Commands
- public void extendPunch() {
+ public void punch() {
punch.set(Constants.Shooter.punch);
}