From: Kevin Zhang Date: Mon, 15 Feb 2016 19:56:45 +0000 (-0800) Subject: Resurrect deleted commit X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=4b94da2f70ac1e3b8197a0712c68263e26cd68e6 Resurrect deleted commit --- diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index 64efa158..ee2742d2 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -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 edu.wpi.first.wpilibj.CANTalon; import edu.wpi.first.wpilibj.CounterBase.EncodingType; @@ -48,12 +49,8 @@ public class Shooter extends Subsystem { } 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() { @@ -72,7 +69,7 @@ public class Shooter extends Subsystem { } // Punch Commands - public void extendPunch() { + public void punch() { punch.set(Constants.Shooter.punch); }