1 package org
.usfirst
.frc
.team3501
.robot
;
4 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.BrakeCANTalons
;
5 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.CoastCANTalons
;
7 import java
.awt
.event
.KeyEvent
;
8 import java
.awt
.event
.KeyListener
;
10 import org
.usfirst
.frc
.team3501
.robot
.commands
.climber
.ToggleWinch
;
11 >>>>>>> Fix ChangeCameraView
12 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ToggleGear
;
13 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.ReverseIntakeContinuous
;
14 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.RunIntakeContinuous
;
15 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.DecreaseShootingSpeed
;
16 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.IncreaseShootingSpeed
;
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
;
21 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.ToggleIndexerPiston
;
23 >>>>>>> Fix ChangeCameraView
24 import org
.usfirst
.frc
.team3501
.robot
.utils
.ChangeCameraView
;
26 import edu
.wpi
.first
.wpilibj
.Joystick
;
27 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
28 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
31 public class OI
/* implements KeyListener */ {
33 public class OI
implements KeyListener
{
34 >>>>>>> Fix ChangeCameraView
36 public static Joystick leftJoystick
;
37 public static Joystick rightJoystick
;
39 public static Button runIndexWheel
;
40 public static Button reverseIndexWheel
;
41 public static Button toggleFlyWheel
;
43 public static Button toggleGear
;
45 public static Button runIntake
;
46 public static Button reverseIntake
;
48 public static Button increaseShooterSpeed
;
49 public static Button decreaseShooterSpeed
;
51 private static Button changeCam
;
53 private static Button togglePiston
;
54 private static Button toggleDriveTrainPiston
;
56 public static Button brakeCANTalons
;
57 public static Button coastCANTalons
;
61 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
62 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
64 runIndexWheel
= new JoystickButton(rightJoystick
,
65 Constants
.OI
.RUN_INDEXWHEEL_PORT
);
66 runIndexWheel
.whileHeld(new RunIndexWheelContinuous());
68 reverseIndexWheel
= new JoystickButton(rightJoystick
,
69 Constants
.OI
.REVERSE_INDEXWHEEL_PORT
);
70 reverseIndexWheel
.whileHeld(new ReverseIndexWheelContinuous());
72 toggleFlyWheel
= new JoystickButton(rightJoystick
,
73 Constants
.OI
.TOGGLE_FLYWHEEL_PORT
);
74 toggleFlyWheel
.toggleWhenPressed(new RunFlyWheelContinuous());
76 toggleGear
= new JoystickButton(leftJoystick
,
77 Constants
.OI
.TOGGLE_GEAR_PORT
);
78 toggleGear
.whenPressed(new ToggleGear());
80 runIntake
= new JoystickButton(leftJoystick
, Constants
.OI
.RUN_INTAKE_PORT
);
81 runIntake
.whileHeld(new RunIntakeContinuous());
83 reverseIntake
= new JoystickButton(leftJoystick
,
84 Constants
.OI
.REVERSE_INTAKE_PORT
);
85 reverseIntake
.whileHeld(new ReverseIntakeContinuous());
87 increaseShooterSpeed
= new JoystickButton(leftJoystick
,
88 Constants
.OI
.INCREASE_SHOOTER_SPEED_PORT
);
89 increaseShooterSpeed
.whenPressed(new IncreaseShootingSpeed());
91 decreaseShooterSpeed
= new JoystickButton(leftJoystick
,
92 Constants
.OI
.DECREASE_SHOOTER_SPEED_PORT
);
93 decreaseShooterSpeed
.whenPressed(new DecreaseShootingSpeed());
95 changeCam
= new JoystickButton(rightJoystick
,
96 Constants
.OI
.CHANGE_CAMERA_VIEW
);
97 changeCam
.toggleWhenPressed(new ChangeCameraView());
99 togglePiston
= new JoystickButton(rightJoystick
,
100 Constants
.Shooter
.TOGGLE_INDEXER
);
101 togglePiston
.whenPressed(new ToggleIndexerPiston());
103 toggleDriveTrainPiston
= new JoystickButton(rightJoystick
,
104 Constants
.DriveTrain
.TOGGLE_DRIVE_PISTON
);
105 toggleDriveTrainPiston
.whenPressed(new ToggleGear());
107 brakeCANTalons
= new JoystickButton(rightJoystick
,
108 Constants
.OI
.BRAKE_CANTALONS_PORT
);
109 brakeCANTalons
.whenPressed(new BrakeCANTalons());
111 coastCANTalons
= new JoystickButton(rightJoystick
,
112 Constants
.OI
.COAST_CANTALONS_PORT
);
113 coastCANTalons
.whenPressed(new CoastCANTalons());
116 public static OI
getOI() {
124 * @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() ==
125 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
126 * Robot.getShooter().runIndexWheel(); } }
128 * @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() ==
129 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
130 * Robot.getShooter().stopIndexWheel(); } }
132 * @Override public void keyTyped(KeyEvent e) { }
137 public void keyTyped(KeyEvent e
) {
142 public void keyPressed(KeyEvent e
) {
143 // TODO Auto-generated method stub
148 public void keyReleased(KeyEvent e
) {
149 // TODO Auto-generated method stub
152 >>>>>>> Fix ChangeCameraView