87f069bdb8ce692ad33721fcbb7ed4d570bd3d89
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / OI.java
1 package org.usfirst.frc.team3501.robot;
2
3
4
5 import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
6 =======
7 import org.usfirst.frc.team3501.robot.commands.accessories.ToggleCameraFeed;
8 >>>>>>> added command for toggling camera feeds
9 =======
10 import org.usfirst.frc.team3501.robot.commands.accessories.ToggleCameraFeed;
11 >>>>>>> cb0f662264528bcb0d783fcb00db22eb8d4f4283
12
13 import edu.wpi.first.wpilibj.Joystick;
14 import edu.wpi.first.wpilibj.buttons.Button;
15 import edu.wpi.first.wpilibj.buttons.JoystickButton;
16
17 public class OI {
18 private static OI oi;
19 public static Joystick leftJoystick;
20 public static Joystick rightJoystick;
21 public static Button toggleWinch;
22
23 public static Button toggleIndexWheel;
24 public static Button toggleFlyWheel;
25
26 public static Button toggleCameraFeeds;
27
28 public static Button toggleCameraFeeds;
29
30 public static Button toggleGear;
31
32 public OI() {
33 leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
34 rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
35 toggleWinch = new JoystickButton(leftJoystick,
36 Constants.OI.TOGGLE_WINCH_PORT);
37 toggleIndexWheel = new JoystickButton(leftJoystick,
38 Constants.OI.TOGGLE_INDEXWHEEL_PORT);
39 toggleFlyWheel = new JoystickButton(leftJoystick,
40 Constants.OI.TOGGLE_FLYWHEEL_PORT);
41
42
43 toggleGear = new JoystickButton(leftJoystick,
44 Constants.OI.TOGGLE_GEAR_PORT);
45 toggleGear.whenPressed(new ToggleGear());
46
47
48 toggleCameraFeeds = new JoystickButton(leftJoystick, Constants.OI.TOGGLE_CAMERA_FEEDS);
49
50 toggleCameraFeeds.whenReleased(new ToggleCameraFeed());
51
52
53
54 toggleCameraFeeds = new JoystickButton(leftJoystick, Constants.OI.TOGGLE_CAMERA_FEEDS);
55
56 toggleCameraFeeds.whenReleased(new ToggleCameraFeed());
57
58 }
59
60 public static OI getOI() {
61 if (oi == null)
62 oi = new OI();
63 return oi;
64 }
65 }