From 7a94939429ce650be29d217a3d3206201346436e Mon Sep 17 00:00:00 2001 From: EvanYap Date: Wed, 20 Jan 2016 20:26:09 -0800 Subject: [PATCH] Add thumb button to send to RioLog/Drive console the current speed of the shooter wheel motor --- src/org/usfirst/frc/team3501/robot/Constants.java | 1 + src/org/usfirst/frc/team3501/robot/OI.java | 4 ++++ .../frc/team3501/robot/commands/ShooterTest.java | 11 ++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 564f7a14..a4029fe2 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -13,6 +13,7 @@ public class Constants { public final static int RIGHT_STICK_TRIGGER = 0; public final static int RIGHT_STICK_LEFT_SILVER_BUTTON = 0; public final static int RIGHT_STICK_RIGHT_SILVER_BUTTON = 0; + public final static int RIGHT_STICK_THUMB_BUTTON = 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 0bf9e3a4..2a4dd089 100644 --- a/src/org/usfirst/frc/team3501/robot/OI.java +++ b/src/org/usfirst/frc/team3501/robot/OI.java @@ -9,6 +9,7 @@ public class OI { public static Joystick rightJoystick; public static Button leftSilverButton; public static Button rightSilverButton; + public static Button thumbButton; public OI() { leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); @@ -22,6 +23,9 @@ public class OI { Constants.OI.RIGHT_STICK_RIGHT_SILVER_BUTTON); ; + thumbButton = new JoystickButton(rightJoystick, + Constants.OI.RIGHT_STICK_THUMB_BUTTON); + } } diff --git a/src/org/usfirst/frc/team3501/robot/commands/ShooterTest.java b/src/org/usfirst/frc/team3501/robot/commands/ShooterTest.java index da1fc777..b4b24234 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/ShooterTest.java +++ b/src/org/usfirst/frc/team3501/robot/commands/ShooterTest.java @@ -23,23 +23,28 @@ public class ShooterTest extends Command { boolean triggerPressed = Robot.oi.rightJoystick.getTrigger(); boolean leftSidePressed = Robot.oi.leftSilverButton.get(); boolean rightSidePressed = Robot.oi.rightSilverButton.get(); + boolean thumbPressed = Robot.oi.thumbButton.get(); double currentWheelSpeed = Robot.shooter.getCurrentSpeed(); - if (triggerPressed = true) { + if (triggerPressed == true) { Robot.shooter.setSpeed(currentWheelSpeed); } else { Robot.shooter.setSpeed(0.0); } - if (leftSidePressed = true) { + if (leftSidePressed == true) { Robot.shooter.setDecrementSpeed(0.1); } - if (rightSidePressed = true) { + if (rightSidePressed == true) { Robot.shooter.setIncrementSpeed(0.1); } + if (thumbPressed == true) { + System.out.println(Robot.shooter.getCurrentSpeed()); + } + } // Make this return true when this Command no longer needs to run execute() -- 2.30.2