Create toggle gear button and intialize it in constuctor
authorArunima DIvya <adivya822@student.fuhsd.org>
Thu, 2 Feb 2017 05:04:56 +0000 (21:04 -0800)
committerArunima DIvya <adivya822@student.fuhsd.org>
Fri, 3 Feb 2017 03:23:39 +0000 (19:23 -0800)
src/org/usfirst/frc/team3501/robot/OI.java

index 935c4c6e32eb4da8fb3dbc5590e4f51bfef6aea5..ec405ac0aeca44daba0e501381b186e0ba476dbe 100644 (file)
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot;
 
+import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
+
 import edu.wpi.first.wpilibj.Joystick;
 import edu.wpi.first.wpilibj.buttons.Button;
 import edu.wpi.first.wpilibj.buttons.JoystickButton;
@@ -13,6 +15,8 @@ public class OI {
   public static Button toggleIndexWheel;
   public static Button toggleFlyWheel;
 
+  public static Button toggleGear;
+
   public OI() {
     leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
     rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
@@ -22,6 +26,9 @@ public class OI {
         Constants.OI.TOGGLE_INDEXWHEEL_PORT);
     toggleFlyWheel = new JoystickButton(leftJoystick,
         Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    toggleGear = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_GEAR_PORT);
+    toggleGear.whenPressed(new ToggleGear());
   }
 
   public static OI getOI() {