Add thumb button to send to RioLog/Drive console the current speed of the shooter...
authorEvanYap <evanyap.14@gmail.com>
Thu, 21 Jan 2016 04:26:09 +0000 (20:26 -0800)
committerKevin Zhang <icestormf1@gmail.com>
Sat, 23 Jan 2016 03:37:35 +0000 (19:37 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/OI.java
src/org/usfirst/frc/team3501/robot/commands/ShooterTest.java

index 564f7a1467ea4ffc4edb94dd1d3bdb467b9dc0af..a4029fe28ca732db805ed9d1ade57b07f6517d0f 100644 (file)
@@ -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 {
index 0bf9e3a4db2b4d82807d79441f9f4c1d469336a0..2a4dd089d3b895cc7edebda8879db8feb3e7de61 100644 (file)
@@ -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);
+
   }
 
 }
index da1fc777575412d24769ccfadbbdeec00c8a8359..b4b2423487ae5a3b61b8bd985ff34559669481ee 100644 (file)
@@ -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()