1 package org
.usfirst
.frc
.team3501
.robot
;
3 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ToggleGear
;
4 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.ReverseIntakeContinuous
;
5 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.RunIntakeContinuous
;
6 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.DecreaseShootingSpeed
;
7 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.IncreaseShootingSpeed
;
8 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.ReverseIndexWheelContinuous
;
9 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunFlyWheelContinuous
;
10 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunIndexWheelContinuous
;
11 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.ToggleIndexerPiston
;
12 import org
.usfirst
.frc
.team3501
.robot
.utils
.ChangeCameraView
;
14 import edu
.wpi
.first
.wpilibj
.Joystick
;
15 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
16 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
18 public class OI
/* implements KeyListener */ {
20 public static Joystick leftJoystick
;
21 public static Joystick rightJoystick
;
23 public static Button runIndexWheel
;
24 public static Button reverseIndexWheel
;
25 public static Button toggleFlyWheel
;
27 public static Button toggleGear
;
29 public static Button runIntake
;
30 public static Button reverseIntake
;
32 public static Button increaseShooterSpeed
;
33 public static Button decreaseShooterSpeed
;
35 private static Button changeCam
;
37 private static Button togglePiston
;
38 private static Button toggleDriveTrainPiston
;
40 public static Button brakeCANTalons
;
41 public static Button coastCANTalons
;
45 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
46 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
48 runIndexWheel
= new JoystickButton(rightJoystick
,
49 Constants
.OI
.RUN_INDEXWHEEL_PORT
);
50 runIndexWheel
.whileHeld(new RunIndexWheelContinuous());
52 reverseIndexWheel
= new JoystickButton(rightJoystick
,
53 Constants
.OI
.REVERSE_INDEXWHEEL_PORT
);
54 reverseIndexWheel
.whileHeld(new ReverseIndexWheelContinuous());
56 toggleFlyWheel
= new JoystickButton(rightJoystick
,
57 Constants
.OI
.TOGGLE_FLYWHEEL_PORT
);
58 toggleFlyWheel
.toggleWhenPressed(new RunFlyWheelContinuous());
60 toggleGear
= new JoystickButton(leftJoystick
,
61 Constants
.OI
.TOGGLE_GEAR_PORT
);
62 toggleGear
.whenPressed(new ToggleGear());
64 runIntake
= new JoystickButton(leftJoystick
, Constants
.OI
.RUN_INTAKE_PORT
);
65 runIntake
.whileHeld(new RunIntakeContinuous());
67 reverseIntake
= new JoystickButton(leftJoystick
,
68 Constants
.OI
.REVERSE_INTAKE_PORT
);
69 reverseIntake
.whileHeld(new ReverseIntakeContinuous());
71 increaseShooterSpeed
= new JoystickButton(leftJoystick
,
72 Constants
.OI
.INCREASE_SHOOTER_SPEED_PORT
);
73 increaseShooterSpeed
.whenPressed(new IncreaseShootingSpeed());
75 decreaseShooterSpeed
= new JoystickButton(leftJoystick
,
76 Constants
.OI
.DECREASE_SHOOTER_SPEED_PORT
);
77 decreaseShooterSpeed
.whenPressed(new DecreaseShootingSpeed());
79 changeCam
= new JoystickButton(rightJoystick
,
80 Constants
.OI
.CHANGE_CAMERA_VIEW
);
81 changeCam
.toggleWhenPressed(new ChangeCameraView());
83 togglePiston
= new JoystickButton(rightJoystick
,
84 Constants
.Shooter
.TOGGLE_INDEXER
);
85 togglePiston
.whenPressed(new ToggleIndexerPiston());
87 toggleDriveTrainPiston
= new JoystickButton(rightJoystick
,
88 Constants
.DriveTrain
.TOGGLE_DRIVE_PISTON
);
89 toggleDriveTrainPiston
.whenPressed(new ToggleGear());
91 brakeCANTalons
= new JoystickButton(rightJoystick
,
92 Constants
.OI
.BRAKE_CANTALONS_PORT
);
93 brakeCANTalons
.whenPressed(new BrakeCANTalons());
95 coastCANTalons
= new JoystickButton(rightJoystick
,
96 Constants
.OI
.COAST_CANTALONS_PORT
);
97 coastCANTalons
.whenPressed(new CoastCANTalons());
100 public static OI
getOI() {
107 * @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() ==
108 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
109 * Robot.getShooter().runIndexWheel(); } }
111 * @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() ==
112 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
113 * Robot.getShooter().stopIndexWheel(); } }
115 * @Override public void keyTyped(KeyEvent e) { }