Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
9cb4e417 | 3 | import org.usfirst.frc.team3501.robot.commands.accessories.ToggleCameraFeed; |
c4a90614 | 4 | import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear; |
7935bf26 | 5 | |
38a404b3 | 6 | import edu.wpi.first.wpilibj.Joystick; |
de8c65d3 SG |
7 | import edu.wpi.first.wpilibj.buttons.Button; |
8 | import edu.wpi.first.wpilibj.buttons.JoystickButton; | |
38a404b3 KZ |
9 | |
10 | public class OI { | |
cca02549 | 11 | private static OI oi; |
38a404b3 KZ |
12 | public static Joystick leftJoystick; |
13 | public static Joystick rightJoystick; | |
83fa645c | 14 | public static Button toggleWinch; |
38a404b3 | 15 | |
2291f7b3 | 16 | public static Button toggleIndexWheel; |
17 | public static Button toggleFlyWheel; | |
5bee67e1 | 18 | |
9cb4e417 | 19 | public static Button toggleCameraFeeds; |
2291f7b3 | 20 | |
7935bf26 AD |
21 | public static Button toggleGear; |
22 | ||
38a404b3 KZ |
23 | public OI() { |
24 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); | |
25 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
de8c65d3 SG |
26 | toggleWinch = new JoystickButton(leftJoystick, |
27 | Constants.OI.TOGGLE_WINCH_PORT); | |
2291f7b3 | 28 | toggleIndexWheel = new JoystickButton(leftJoystick, |
29 | Constants.OI.TOGGLE_INDEXWHEEL_PORT); | |
30 | toggleFlyWheel = new JoystickButton(leftJoystick, | |
31 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
5bee67e1 | 32 | |
7935bf26 AD |
33 | toggleGear = new JoystickButton(leftJoystick, |
34 | Constants.OI.TOGGLE_GEAR_PORT); | |
35 | toggleGear.whenPressed(new ToggleGear()); | |
5bee67e1 | 36 | |
c4a90614 RH |
37 | toggleCameraFeeds = new JoystickButton(leftJoystick, |
38 | Constants.OI.TOGGLE_CAMERA_FEEDS); | |
5bee67e1 | 39 | |
9cb4e417 | 40 | toggleCameraFeeds.whenReleased(new ToggleCameraFeed()); |
5bee67e1 | 41 | |
c4a90614 RH |
42 | toggleCameraFeeds = new JoystickButton(leftJoystick, |
43 | Constants.OI.TOGGLE_CAMERA_FEEDS); | |
72beefff RH |
44 | |
45 | toggleCameraFeeds.whenReleased(new ToggleCameraFeed()); | |
46 | ||
38a404b3 | 47 | } |
cf086549 SG |
48 | |
49 | public static OI getOI() { | |
50 | if (oi == null) | |
51 | oi = new OI(); | |
52 | return oi; | |
cca02549 | 53 | } |
38a404b3 | 54 | } |