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; | |
5e93f308 CZ |
7 | import org.usfirst.frc.team3501.robot.commands.shooter.DecreaseShootingSpeed; |
8 | import org.usfirst.frc.team3501.robot.commands.shooter.IncreaseShootingSpeed; | |
cef1f36d RR |
9 | import org.usfirst.frc.team3501.robot.commands.shooter.ReverseIndexWheelContinuous; |
10 | import org.usfirst.frc.team3501.robot.commands.shooter.RunFlyWheelContinuous; | |
11 | import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous; | |
7935bf26 | 12 | |
38a404b3 | 13 | import edu.wpi.first.wpilibj.Joystick; |
de8c65d3 SG |
14 | import edu.wpi.first.wpilibj.buttons.Button; |
15 | import edu.wpi.first.wpilibj.buttons.JoystickButton; | |
38a404b3 KZ |
16 | |
17 | public class OI { | |
cca02549 | 18 | private static OI oi; |
38a404b3 KZ |
19 | public static Joystick leftJoystick; |
20 | public static Joystick rightJoystick; | |
83fa645c | 21 | public static Button toggleWinch; |
38a404b3 | 22 | |
cef1f36d RR |
23 | public static Button runIndexWheel; |
24 | public static Button reverseIndexWheel; | |
2291f7b3 | 25 | public static Button toggleFlyWheel; |
26 | ||
7935bf26 AD |
27 | public static Button toggleGear; |
28 | ||
cef1f36d RR |
29 | public static Button runIntake; |
30 | public static Button reverseIntake; | |
31 | ||
5e93f308 CZ |
32 | public static Button increaseShooterSpeed; |
33 | public static Button decreaseShooterSpeed; | |
34 | ||
38a404b3 KZ |
35 | public OI() { |
36 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); | |
37 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
cef1f36d | 38 | |
5e93f308 CZ |
39 | runIndexWheel = new JoystickButton(rightJoystick, |
40 | Constants.OI.RUN_INDEXWHEEL_PORT); | |
cef1f36d RR |
41 | runIndexWheel.whileHeld(new RunIndexWheelContinuous()); |
42 | ||
43 | reverseIndexWheel = new JoystickButton(leftJoystick, | |
44 | Constants.OI.REVERSE_INDEXWHEEL_PORT); | |
45 | reverseIndexWheel.whileHeld(new ReverseIndexWheelContinuous()); | |
46 | ||
5e93f308 | 47 | toggleFlyWheel = new JoystickButton(rightJoystick, |
2291f7b3 | 48 | Constants.OI.TOGGLE_FLYWHEEL_PORT); |
cef1f36d RR |
49 | toggleFlyWheel.toggleWhenPressed(new RunFlyWheelContinuous()); |
50 | ||
7935bf26 AD |
51 | toggleGear = new JoystickButton(leftJoystick, |
52 | Constants.OI.TOGGLE_GEAR_PORT); | |
53 | toggleGear.whenPressed(new ToggleGear()); | |
cef1f36d RR |
54 | |
55 | runIntake = new JoystickButton(leftJoystick, | |
5e93f308 | 56 | Constants.OI.RUN_INTAKE_PORT); |
cef1f36d RR |
57 | runIntake.whileHeld(new RunIntakeContinuous()); |
58 | ||
59 | reverseIntake = new JoystickButton(leftJoystick, | |
60 | Constants.OI.REVERSE_INTAKE_PORT); | |
61 | reverseIntake.whileHeld(new ReverseIntakeContinuous()); | |
62 | ||
63 | toggleWinch = new JoystickButton(leftJoystick, | |
64 | Constants.OI.TOGGLE_WINCH_PORT); | |
25ef99e6 | 65 | toggleWinch.whenPressed(new ToggleWinch()); |
5e93f308 CZ |
66 | |
67 | increaseShooterSpeed = new JoystickButton(leftJoystick, | |
68 | Constants.OI.INCREASE_SHOOTER_SPEED_PORT); | |
69 | increaseShooterSpeed.whenPressed(new IncreaseShootingSpeed()); | |
70 | ||
71 | decreaseShooterSpeed = new JoystickButton(leftJoystick, | |
72 | Constants.OI.DECREASE_SHOOTER_SPEED_PORT); | |
73 | decreaseShooterSpeed.whenPressed(new DecreaseShootingSpeed()); | |
38a404b3 | 74 | } |
cf086549 SG |
75 | |
76 | public static OI getOI() { | |
77 | if (oi == null) | |
78 | oi = new OI(); | |
79 | return oi; | |
cca02549 | 80 | } |
38a404b3 | 81 | } |