Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
9dc69158 | 3 | import org.usfirst.frc.team3501.robot.commands.climber.ToggleWinch; |
7935bf26 | 4 | import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear; |
cef1f36d RR |
5 | import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous; |
6 | import org.usfirst.frc.team3501.robot.commands.intake.RunIntakeContinuous; | |
7 | import org.usfirst.frc.team3501.robot.commands.shooter.ReverseIndexWheelContinuous; | |
8 | import org.usfirst.frc.team3501.robot.commands.shooter.RunFlyWheelContinuous; | |
9 | import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous; | |
7935bf26 | 10 | |
38a404b3 | 11 | import edu.wpi.first.wpilibj.Joystick; |
de8c65d3 SG |
12 | import edu.wpi.first.wpilibj.buttons.Button; |
13 | import edu.wpi.first.wpilibj.buttons.JoystickButton; | |
38a404b3 KZ |
14 | |
15 | public class OI { | |
cca02549 | 16 | private static OI oi; |
38a404b3 KZ |
17 | public static Joystick leftJoystick; |
18 | public static Joystick rightJoystick; | |
83fa645c | 19 | public static Button toggleWinch; |
38a404b3 | 20 | |
cef1f36d RR |
21 | public static Button runIndexWheel; |
22 | public static Button reverseIndexWheel; | |
2291f7b3 | 23 | public static Button toggleFlyWheel; |
24 | ||
7935bf26 AD |
25 | public static Button toggleGear; |
26 | ||
cef1f36d RR |
27 | public static Button runIntake; |
28 | public static Button reverseIntake; | |
29 | ||
38a404b3 KZ |
30 | public OI() { |
31 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); | |
32 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
cef1f36d RR |
33 | |
34 | runIndexWheel = new JoystickButton(leftJoystick, | |
2291f7b3 | 35 | Constants.OI.TOGGLE_INDEXWHEEL_PORT); |
cef1f36d RR |
36 | runIndexWheel.whileHeld(new RunIndexWheelContinuous()); |
37 | ||
38 | reverseIndexWheel = new JoystickButton(leftJoystick, | |
39 | Constants.OI.REVERSE_INDEXWHEEL_PORT); | |
40 | reverseIndexWheel.whileHeld(new ReverseIndexWheelContinuous()); | |
41 | ||
2291f7b3 | 42 | toggleFlyWheel = new JoystickButton(leftJoystick, |
43 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
cef1f36d RR |
44 | toggleFlyWheel.toggleWhenPressed(new RunFlyWheelContinuous()); |
45 | ||
7935bf26 AD |
46 | toggleGear = new JoystickButton(leftJoystick, |
47 | Constants.OI.TOGGLE_GEAR_PORT); | |
48 | toggleGear.whenPressed(new ToggleGear()); | |
cef1f36d RR |
49 | |
50 | runIntake = new JoystickButton(leftJoystick, | |
51 | Constants.OI.TOGGLE_INTAKE_PORT); | |
52 | runIntake.whileHeld(new RunIntakeContinuous()); | |
53 | ||
54 | reverseIntake = new JoystickButton(leftJoystick, | |
55 | Constants.OI.REVERSE_INTAKE_PORT); | |
56 | reverseIntake.whileHeld(new ReverseIntakeContinuous()); | |
57 | ||
58 | toggleWinch = new JoystickButton(leftJoystick, | |
59 | Constants.OI.TOGGLE_WINCH_PORT); | |
25ef99e6 | 60 | toggleWinch.whenPressed(new ToggleWinch()); |
38a404b3 | 61 | } |
cf086549 SG |
62 | |
63 | public static OI getOI() { | |
64 | if (oi == null) | |
65 | oi = new OI(); | |
66 | return oi; | |
cca02549 | 67 | } |
38a404b3 | 68 | } |