Add buttons to OI class
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / OI.java
CommitLineData
38a404b3
KZ
1package org.usfirst.frc.team3501.robot;
2
3import edu.wpi.first.wpilibj.Joystick;
de8c65d3
SG
4import edu.wpi.first.wpilibj.buttons.Button;
5import edu.wpi.first.wpilibj.buttons.JoystickButton;
38a404b3
KZ
6
7public class OI {
cca02549 8 private static OI oi;
38a404b3
KZ
9 public static Joystick leftJoystick;
10 public static Joystick rightJoystick;
83fa645c 11 public static Button toggleWinch;
38a404b3 12
2291f7b3 13 public static Button toggleIndexWheel;
14 public static Button toggleFlyWheel;
15
38a404b3
KZ
16 public OI() {
17 leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
18 rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
de8c65d3
SG
19 toggleWinch = new JoystickButton(leftJoystick,
20 Constants.OI.TOGGLE_WINCH_PORT);
38a404b3 21
2291f7b3 22 toggleIndexWheel = new JoystickButton(leftJoystick,
23 Constants.OI.TOGGLE_INDEXWHEEL_PORT);
24 toggleFlyWheel = new JoystickButton(leftJoystick,
25 Constants.OI.TOGGLE_FLYWHEEL_PORT);
26
38a404b3 27 }
cf086549
SG
28
29 public static OI getOI() {
30 if (oi == null)
31 oi = new OI();
32 return oi;
cca02549 33 }
38a404b3 34}