Add command to change active gear
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / OI.java
index e2d821656202b4e09b43e74bd7bd785efb95ee1e..cb7e12d9b3120c094e24f39869be0d6deea94cf6 100644 (file)
@@ -1,7 +1,10 @@
 package org.usfirst.frc.team3501.robot;
 
+import org.usfirst.frc.team3501.robot.commands.driving.ChangeGear;
+
 import edu.wpi.first.wpilibj.Joystick;
 import edu.wpi.first.wpilibj.buttons.Button;
+import edu.wpi.first.wpilibj.buttons.JoystickButton;
 
 public class OI {
   public static Joystick leftJoystick;
@@ -30,6 +33,7 @@ public class OI {
   // right joystick buttons
   public static Button intakeBoulder;
   public static Button shootBoulder;
+  public static Button toggleGear;
 
   // button to change robot to the scaling mode
   public static DigitalButton toggleScaling;
@@ -38,6 +42,10 @@ public class OI {
     leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
     rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
 
+    toggleGear = new JoystickButton(rightJoystick,
+        Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT);
+    toggleGear.toggleWhenPressed(new ChangeGear());
+
     // passPortcullis = new DigitalButton(
     // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
     // passPortcullis.whenPressed(new PassPortcullis());