From: Harel Dor Date: Mon, 22 Feb 2016 04:00:13 +0000 (-0800) Subject: Add command to change active gear X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=86d7310bff2430b6963fec800ac441d4314a2c3a Add command to change active gear --- diff --git a/src/org/usfirst/frc/team3501/robot/OI.java b/src/org/usfirst/frc/team3501/robot/OI.java index e2d82165..cb7e12d9 100644 --- a/src/org/usfirst/frc/team3501/robot/OI.java +++ b/src/org/usfirst/frc/team3501/robot/OI.java @@ -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()); diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 154796c5..5bb61f14 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -120,8 +120,7 @@ public class Robot extends IterativeRobot { @Override public void teleopInit() { - Scheduler.getInstance().add(new JoystickDrive()); - + Robot.driveTrain.setLowGear(); } @Override