From: shainachen Date: Sun, 15 Jan 2017 00:30:13 +0000 (-0800) Subject: Add buttons to OI class X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=2291f7b34887ea3a0b77979421381165d06313db Add buttons to OI class --- diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index c93d643..e0d7f64 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -11,6 +11,9 @@ public class Constants { public final static int LEFT_STICK_PORT = 0; public final static int RIGHT_STICK_PORT = 1; public final static int TOGGLE_WINCH_PORT = 0; + + public final static int TOGGLE_FLYWHEEL_PORT = 0; + public final static int TOGGLE_INDEXWHEEL_PORT = 0; } public static class DriveTrain { diff --git a/src/org/usfirst/frc/team3501/robot/OI.java b/src/org/usfirst/frc/team3501/robot/OI.java index e72c028..d21fe84 100644 --- a/src/org/usfirst/frc/team3501/robot/OI.java +++ b/src/org/usfirst/frc/team3501/robot/OI.java @@ -10,12 +10,20 @@ public class OI { public static Joystick rightJoystick; public static Button toggleWinch; + public static Button toggleIndexWheel; + public static Button toggleFlyWheel; + public OI() { leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); toggleWinch = new JoystickButton(leftJoystick, Constants.OI.TOGGLE_WINCH_PORT); + toggleIndexWheel = new JoystickButton(leftJoystick, + Constants.OI.TOGGLE_INDEXWHEEL_PORT); + toggleFlyWheel = new JoystickButton(leftJoystick, + Constants.OI.TOGGLE_FLYWHEEL_PORT); + } public static OI getOI() { diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 00ad1cb..451d339 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -11,7 +11,6 @@ public class Robot extends IterativeRobot { private static DriveTrain driveTrain; private static Shooter shooter; private static OI oi; - private static Shooter shooter; @Override public void robotInit() { diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java index 8a6e5be..806611d 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java @@ -53,8 +53,7 @@ public class RunFlyWheelContinuous extends Command { @Override protected boolean isFinished() { // TODO - return false; - + return !Robot.getOI().toggleFlyWheel.get(); } } diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java index 2c24338..d3d49b8 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java @@ -53,7 +53,7 @@ public class RunIndexWheelContinuous extends Command { @Override protected boolean isFinished() { // TODO - return false; + return Robot.getOI().toggleIndexWheel.get(); } }