Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
43af141e | 3 | <<<<<<< HEAD |
2e70084e RR |
4 | import org.usfirst.frc.team3501.robot.commands.driving.BrakeCANTalons; |
5 | import org.usfirst.frc.team3501.robot.commands.driving.CoastCANTalons; | |
43af141e RR |
6 | ======= |
7 | import java.awt.event.KeyEvent; | |
8 | import java.awt.event.KeyListener; | |
9 | ||
10 | import org.usfirst.frc.team3501.robot.commands.climber.ToggleWinch; | |
11 | >>>>>>> Fix ChangeCameraView | |
7935bf26 | 12 | import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear; |
cef1f36d RR |
13 | import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous; |
14 | import org.usfirst.frc.team3501.robot.commands.intake.RunIntakeContinuous; | |
5e93f308 CZ |
15 | import org.usfirst.frc.team3501.robot.commands.shooter.DecreaseShootingSpeed; |
16 | import org.usfirst.frc.team3501.robot.commands.shooter.IncreaseShootingSpeed; | |
cef1f36d RR |
17 | import org.usfirst.frc.team3501.robot.commands.shooter.ReverseIndexWheelContinuous; |
18 | import org.usfirst.frc.team3501.robot.commands.shooter.RunFlyWheelContinuous; | |
19 | import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous; | |
43af141e | 20 | <<<<<<< HEAD |
49b8e933 | 21 | import org.usfirst.frc.team3501.robot.commands.shooter.ToggleIndexerPiston; |
43af141e RR |
22 | ======= |
23 | >>>>>>> Fix ChangeCameraView | |
e4082bee | 24 | import org.usfirst.frc.team3501.robot.utils.ChangeCameraView; |
7935bf26 | 25 | |
38a404b3 | 26 | import edu.wpi.first.wpilibj.Joystick; |
de8c65d3 SG |
27 | import edu.wpi.first.wpilibj.buttons.Button; |
28 | import edu.wpi.first.wpilibj.buttons.JoystickButton; | |
38a404b3 | 29 | |
43af141e | 30 | <<<<<<< HEAD |
49b8e933 | 31 | public class OI /* implements KeyListener */ { |
43af141e RR |
32 | ======= |
33 | public class OI implements KeyListener { | |
34 | >>>>>>> Fix ChangeCameraView | |
cca02549 | 35 | private static OI oi; |
38a404b3 KZ |
36 | public static Joystick leftJoystick; |
37 | public static Joystick rightJoystick; | |
38 | ||
cef1f36d RR |
39 | public static Button runIndexWheel; |
40 | public static Button reverseIndexWheel; | |
2291f7b3 | 41 | public static Button toggleFlyWheel; |
42 | ||
7935bf26 AD |
43 | public static Button toggleGear; |
44 | ||
cef1f36d RR |
45 | public static Button runIntake; |
46 | public static Button reverseIntake; | |
47 | ||
5e93f308 CZ |
48 | public static Button increaseShooterSpeed; |
49 | public static Button decreaseShooterSpeed; | |
50 | ||
ee1a8006 RR |
51 | private static Button changeCam; |
52 | ||
49b8e933 RR |
53 | private static Button togglePiston; |
54 | private static Button toggleDriveTrainPiston; | |
55 | ||
f56e6ebf CZ |
56 | public static Button brakeCANTalons; |
57 | public static Button coastCANTalons; | |
58 | ||
38a404b3 | 59 | public OI() { |
49b8e933 | 60 | |
38a404b3 KZ |
61 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); |
62 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
cef1f36d | 63 | |
5e93f308 CZ |
64 | runIndexWheel = new JoystickButton(rightJoystick, |
65 | Constants.OI.RUN_INDEXWHEEL_PORT); | |
a6695a85 | 66 | runIndexWheel.whileHeld(new RunIndexWheelContinuous()); |
cef1f36d | 67 | |
aec45ad9 | 68 | reverseIndexWheel = new JoystickButton(rightJoystick, |
cef1f36d RR |
69 | Constants.OI.REVERSE_INDEXWHEEL_PORT); |
70 | reverseIndexWheel.whileHeld(new ReverseIndexWheelContinuous()); | |
71 | ||
5e93f308 | 72 | toggleFlyWheel = new JoystickButton(rightJoystick, |
2291f7b3 | 73 | Constants.OI.TOGGLE_FLYWHEEL_PORT); |
cef1f36d RR |
74 | toggleFlyWheel.toggleWhenPressed(new RunFlyWheelContinuous()); |
75 | ||
7935bf26 AD |
76 | toggleGear = new JoystickButton(leftJoystick, |
77 | Constants.OI.TOGGLE_GEAR_PORT); | |
78 | toggleGear.whenPressed(new ToggleGear()); | |
cef1f36d | 79 | |
aec45ad9 | 80 | runIntake = new JoystickButton(leftJoystick, Constants.OI.RUN_INTAKE_PORT); |
cef1f36d RR |
81 | runIntake.whileHeld(new RunIntakeContinuous()); |
82 | ||
83 | reverseIntake = new JoystickButton(leftJoystick, | |
84 | Constants.OI.REVERSE_INTAKE_PORT); | |
85 | reverseIntake.whileHeld(new ReverseIntakeContinuous()); | |
86 | ||
5e93f308 CZ |
87 | increaseShooterSpeed = new JoystickButton(leftJoystick, |
88 | Constants.OI.INCREASE_SHOOTER_SPEED_PORT); | |
89 | increaseShooterSpeed.whenPressed(new IncreaseShootingSpeed()); | |
90 | ||
91 | decreaseShooterSpeed = new JoystickButton(leftJoystick, | |
92 | Constants.OI.DECREASE_SHOOTER_SPEED_PORT); | |
93 | decreaseShooterSpeed.whenPressed(new DecreaseShootingSpeed()); | |
ee1a8006 | 94 | |
e4082bee RR |
95 | changeCam = new JoystickButton(rightJoystick, |
96 | Constants.OI.CHANGE_CAMERA_VIEW); | |
97 | changeCam.toggleWhenPressed(new ChangeCameraView()); | |
49b8e933 RR |
98 | |
99 | togglePiston = new JoystickButton(rightJoystick, | |
100 | Constants.Shooter.TOGGLE_INDEXER); | |
101 | togglePiston.whenPressed(new ToggleIndexerPiston()); | |
102 | ||
103 | toggleDriveTrainPiston = new JoystickButton(rightJoystick, | |
104 | Constants.DriveTrain.TOGGLE_DRIVE_PISTON); | |
e4082bee | 105 | toggleDriveTrainPiston.whenPressed(new ToggleGear()); |
6bc81b55 | 106 | |
f56e6ebf CZ |
107 | brakeCANTalons = new JoystickButton(rightJoystick, |
108 | Constants.OI.BRAKE_CANTALONS_PORT); | |
109 | brakeCANTalons.whenPressed(new BrakeCANTalons()); | |
110 | ||
111 | coastCANTalons = new JoystickButton(rightJoystick, | |
112 | Constants.OI.COAST_CANTALONS_PORT); | |
113 | coastCANTalons.whenPressed(new CoastCANTalons()); | |
38a404b3 | 114 | } |
cf086549 SG |
115 | |
116 | public static OI getOI() { | |
117 | if (oi == null) | |
118 | oi = new OI(); | |
119 | return oi; | |
cca02549 | 120 | } |
99930d53 | 121 | |
43af141e | 122 | <<<<<<< HEAD |
49b8e933 RR |
123 | /* |
124 | * @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == | |
125 | * KeyEvent.VK_Z) { // Robot.swapCameraFeed(); | |
126 | * Robot.getShooter().runIndexWheel(); } } | |
127 | * | |
128 | * @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() == | |
129 | * KeyEvent.VK_Z) { // Robot.swapCameraFeed(); | |
130 | * Robot.getShooter().stopIndexWheel(); } } | |
131 | * | |
132 | * @Override public void keyTyped(KeyEvent e) { } | |
133 | */ | |
99930d53 | 134 | |
43af141e RR |
135 | ======= |
136 | @Override | |
137 | public void keyTyped(KeyEvent e) { | |
138 | ||
139 | } | |
140 | ||
141 | @Override | |
142 | public void keyPressed(KeyEvent e) { | |
143 | // TODO Auto-generated method stub | |
144 | ||
145 | } | |
146 | ||
147 | @Override | |
148 | public void keyReleased(KeyEvent e) { | |
149 | // TODO Auto-generated method stub | |
150 | ||
151 | } | |
152 | >>>>>>> Fix ChangeCameraView | |
38a404b3 | 153 | } |