X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FShooter.java;h=9e0263697261ab33a8fc022037200714ddf77026;hb=9e247b05247ccbfa685fbf5ab9b62d769f573b35;hp=c562b20adfb727295ddd8ffba19addba4133b6d2;hpb=8a3948435823ea5cd600f68fbbd19341f57c5758;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index c562b20a..9e026369 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -6,42 +6,29 @@ import edu.wpi.first.wpilibj.CANTalon; import edu.wpi.first.wpilibj.command.Subsystem; public class Shooter extends Subsystem { - CANTalon wheel; + CANTalon shooter; public Shooter() { - wheel = new CANTalon(Constants.Shooter.SHOOTER_WHEEL_PORT); + shooter = new CANTalon(Constants.Shooter.SHOOTER_WHEEL_PORT); } public double getCurrentSpeed() { - return wheel.get(); + return shooter.get(); } public void setSpeed(double speed) { - wheel.set(speed); + shooter.set(speed); } - public void incrementSpeed(double increment) { + // Use negative # for decrement. Positive for increment. + public void changeSpeed(double change) { if (getCurrentSpeed() >= 1.0) - wheel.set(1.0); + shooter.set(1.0); else if (getCurrentSpeed() <= -1.0) - wheel.set(-1.0); + shooter.set(-1.0); else { - double newSpeed = getCurrentSpeed() + increment; - wheel.set(newSpeed); - } - } - - // THIS DECREMENT METHOD TAKES ONLY POSITIVE VALUES SINCE IT ACCOUNTS FOR - // SUBTRACTING THE CURRENT MOTOR SPEED! - public void decrementSpeed(double decrement) { - - if (getCurrentSpeed() >= 1.0) - wheel.set(1.0); - else if (getCurrentSpeed() <= -1.0) - wheel.set(-1.0); - else { - double newSpeed = getCurrentSpeed() - decrement; - wheel.set(newSpeed); + double newSpeed = getCurrentSpeed() + change; + shooter.set(newSpeed); } }