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