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); | |
d0b0d55d | 53 | |
7935bf26 | 54 | toggleGear.whenPressed(new ToggleGear()); |
cef1f36d RR |
55 | |
56 | runIntake = new JoystickButton(leftJoystick, | |
5e93f308 | 57 | Constants.OI.RUN_INTAKE_PORT); |
cef1f36d RR |
58 | runIntake.whileHeld(new RunIntakeContinuous()); |
59 | ||
60 | reverseIntake = new JoystickButton(leftJoystick, | |
61 | Constants.OI.REVERSE_INTAKE_PORT); | |
62 | reverseIntake.whileHeld(new ReverseIntakeContinuous()); | |
63 | ||
64 | toggleWinch = new JoystickButton(leftJoystick, | |
65 | Constants.OI.TOGGLE_WINCH_PORT); | |
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()); | |
ffb43c5c | 74 | |
731aef6d RR |
75 | /* |
76 | * if (!Robot.getDriveTrain().isClimbing()) { toggleWinch.whenPressed(new | |
77 | * RunWinchContinuous()); Robot.getDriveTrain().setClimbing(true); } else { | |
78 | * toggleWinch.whenPressed(new MaintainClimbedPosition()); | |
79 | * Robot.getDriveTrain().setClimbing(false); } | |
80 | */ | |
81 | toggleWinch.whenPressed(new ToggleWinch()); | |
3eb26e6f | 82 | |
38a404b3 | 83 | } |
cf086549 SG |
84 | |
85 | public static OI getOI() { | |
86 | if (oi == null) | |
87 | oi = new OI(); | |
88 | return oi; | |
cca02549 | 89 | } |
38a404b3 | 90 | } |