From: Cindy Zhang Date: Fri, 10 Feb 2017 04:05:48 +0000 (-0800) Subject: add second motor controller for shooter X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=3a86b1a511ebbed2d97a8f33092e22599d675d24 add second motor controller for shooter --- diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 671de15..13e8b27 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -27,7 +27,8 @@ public class Constants { public static class Shooter { // MOTOR CONTROLLERS - public static final int FLY_WHEEL = 0; + public static final int FLY_WHEEL1 = 0; + public static final int FLY_WHEEL2 = 0; public static final int INDEX_WHEEL = 0; public final static int TOGGLE_WINCH_PORT = 0; diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index d786d22..0c58ba3 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -11,7 +11,7 @@ public class Shooter extends Subsystem { public double wheelP = 0, wheelI = 0, wheelD = -0; private static Shooter shooter; private static HallEffectSensor hallEffect; - private final CANTalon flyWheel, indexWheel; + private final CANTalon flyWheel1, flyWheel2, indexWheel; public static final double DEFAULT_INDEXING_SPEED = 0; public static final double DEFAULT_SHOOTING_SPEED = 0; @@ -20,7 +20,8 @@ public class Shooter extends Subsystem { public static final double SHOOTING_SPEED_INCREMENT = 0; private Shooter() { - flyWheel = new CANTalon(Constants.Shooter.FLY_WHEEL); + flyWheel1 = new CANTalon(Constants.Shooter.FLY_WHEEL1); + flyWheel2 = new CANTalon(Constants.Shooter.FLY_WHEEL2); indexWheel = new CANTalon(Constants.Shooter.INDEX_WHEEL); hallEffect = new HallEffectSensor(Constants.Shooter.HALL_EFFECT_PORT, 1); @@ -49,14 +50,16 @@ public class Shooter extends Subsystem { * motor value from -1 to 1(fastest forward) */ public void setFlyWheelMotorVal(final double val) { - flyWheel.set(val); + flyWheel1.set(val); + flyWheel2.set(val); } /** * Stops fly wheel motor. */ public void stopFlyWheel() { - flyWheel.set(0); + flyWheel1.set(0); + flyWheel2.set(0); } /**