Add command to change active gear
authorHarel Dor <hareldor@gmail.com>
Mon, 22 Feb 2016 04:00:13 +0000 (20:00 -0800)
committerHarel Dor <hareldor@gmail.com>
Tue, 23 Feb 2016 00:31:48 +0000 (16:31 -0800)
src/org/usfirst/frc/team3501/robot/OI.java
src/org/usfirst/frc/team3501/robot/Robot.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());
index 154796c5edb5bbde552998971b30d17fedcaa8b8..5bb61f143bc139c14b81221919ef90893b4c0382 100644 (file)
@@ -120,8 +120,7 @@ public class Robot extends IterativeRobot {
 
   @Override
   public void teleopInit() {
-    Scheduler.getInstance().add(new JoystickDrive());
-
+    Robot.driveTrain.setLowGear();
   }
 
   @Override