Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
571a0e2a HD |
3 | import org.usfirst.frc.team3501.robot.commands.driving.SetHighGear; |
4 | import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear; | |
5 | import org.usfirst.frc.team3501.robot.commands.driving.ToggleFront; | |
6 | import org.usfirst.frc.team3501.robot.commands.intakearm.RunIntake; | |
7 | import org.usfirst.frc.team3501.robot.commands.intakearm.StopIntake; | |
6b06b2bc | 8 | import org.usfirst.frc.team3501.robot.commands.shooter.Shoot; |
37e5a121 | 9 | |
38a404b3 | 10 | import edu.wpi.first.wpilibj.Joystick; |
cb3389eb E |
11 | import edu.wpi.first.wpilibj.buttons.Button; |
12 | import edu.wpi.first.wpilibj.buttons.JoystickButton; | |
38a404b3 KZ |
13 | |
14 | public class OI { | |
15 | public static Joystick leftJoystick; | |
16 | public static Joystick rightJoystick; | |
6b06b2bc | 17 | |
6b06b2bc | 18 | // left joystick buttons |
571a0e2a | 19 | public static Button gearTrigger; |
6b06b2bc CZ |
20 | |
21 | // right joystick buttons | |
571a0e2a | 22 | public static Button intakeTrigger; |
6b06b2bc | 23 | public static Button shootBoulder; |
571a0e2a | 24 | public static Button toggleFront; |
38a404b3 KZ |
25 | |
26 | public OI() { | |
27 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); | |
28 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
29 | ||
571a0e2a HD |
30 | // Left joystick |
31 | gearTrigger = new JoystickButton(leftJoystick, | |
6b06b2bc | 32 | Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT); |
571a0e2a HD |
33 | gearTrigger.whenPressed(new SetHighGear()); |
34 | gearTrigger.whenReleased(new SetLowGear()); | |
52ef246c | 35 | |
571a0e2a HD |
36 | // Right joystick |
37 | intakeTrigger = new JoystickButton(rightJoystick, | |
6b06b2bc | 38 | Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT); |
571a0e2a HD |
39 | intakeTrigger.whenPressed(new RunIntake()); |
40 | intakeTrigger.whenReleased(new StopIntake()); | |
6b06b2bc | 41 | |
571a0e2a HD |
42 | shootBoulder = new JoystickButton(rightJoystick, |
43 | Constants.OI.RIGHT_JOYSTICK_SHOOT_PORT); | |
44 | shootBoulder.whenPressed(new Shoot()); | |
7a949394 | 45 | |
571a0e2a HD |
46 | toggleFront = new JoystickButton(rightJoystick, |
47 | Constants.OI.RIGHT_JOYSTICK_THUMB_PORT); | |
48 | toggleFront.whenPressed(new ToggleFront()); | |
38a404b3 KZ |
49 | } |
50 | } |