From 86d7310bff2430b6963fec800ac441d4314a2c3a Mon Sep 17 00:00:00 2001 From: Harel Dor Date: Sun, 21 Feb 2016 20:00:13 -0800 Subject: [PATCH] Add command to change active gear --- src/org/usfirst/frc/team3501/robot/OI.java | 8 ++++++++ src/org/usfirst/frc/team3501/robot/Robot.java | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) 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 -- 2.30.2