From 4b94da2f70ac1e3b8197a0712c68263e26cd68e6 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Mon, 15 Feb 2016 11:56:45 -0800 Subject: [PATCH] Resurrect deleted commit --- .../frc/team3501/robot/subsystems/Shooter.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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); } -- 2.30.2