1 package org
.usfirst
.frc
.team3501
.robot
;
3 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.BrakeCANTalons
;
4 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.CoastCANTalons
;
5 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ToggleGear
;
6 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.ReverseIntakeContinuous
;
7 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.RunIntakeContinuous
;
8 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.DecreaseShootingSpeed
;
9 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.IncreaseShootingSpeed
;
10 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.ReverseIndexWheelContinuous
;
11 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunFlyWheelContinuous
;
12 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunIndexWheelContinuous
;
13 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.ToggleIndexerPiston
;
14 import org
.usfirst
.frc
.team3501
.robot
.utils
.ChangeCameraView
;
16 import edu
.wpi
.first
.wpilibj
.Joystick
;
17 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
18 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
20 public class OI
/* implements KeyListener */ {
22 public static Joystick leftJoystick
;
23 public static Joystick rightJoystick
;
25 public static Button runIndexWheel
;
26 public static Button reverseIndexWheel
;
27 public static Button toggleFlyWheel
;
29 public static Button toggleGear
;
31 public static Button runIntake
;
32 public static Button reverseIntake
;
34 public static Button increaseShooterSpeed
;
35 public static Button decreaseShooterSpeed
;
37 private static Button changeCam
;
39 private static Button togglePiston
;
40 private static Button toggleDriveTrainPiston
;
42 public static Button brakeCANTalons
;
43 public static Button coastCANTalons
;
47 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
48 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
50 runIndexWheel
= new JoystickButton(rightJoystick
,
51 Constants
.OI
.RUN_INDEXWHEEL_PORT
);
52 runIndexWheel
.whileHeld(new RunIndexWheelContinuous());
54 reverseIndexWheel
= new JoystickButton(rightJoystick
,
55 Constants
.OI
.REVERSE_INDEXWHEEL_PORT
);
56 reverseIndexWheel
.whileHeld(new ReverseIndexWheelContinuous());
58 toggleFlyWheel
= new JoystickButton(rightJoystick
,
59 Constants
.OI
.TOGGLE_FLYWHEEL_PORT
);
60 toggleFlyWheel
.toggleWhenPressed(new RunFlyWheelContinuous());
62 toggleGear
= new JoystickButton(leftJoystick
,
63 Constants
.OI
.TOGGLE_GEAR_PORT
);
64 toggleGear
.whenPressed(new ToggleGear());
66 runIntake
= new JoystickButton(leftJoystick
, Constants
.OI
.RUN_INTAKE_PORT
);
67 runIntake
.whileHeld(new RunIntakeContinuous());
69 reverseIntake
= new JoystickButton(leftJoystick
,
70 Constants
.OI
.REVERSE_INTAKE_PORT
);
71 reverseIntake
.whileHeld(new ReverseIntakeContinuous());
73 increaseShooterSpeed
= new JoystickButton(leftJoystick
,
74 Constants
.OI
.INCREASE_SHOOTER_SPEED_PORT
);
75 increaseShooterSpeed
.whenPressed(new IncreaseShootingSpeed());
77 decreaseShooterSpeed
= new JoystickButton(leftJoystick
,
78 Constants
.OI
.DECREASE_SHOOTER_SPEED_PORT
);
79 decreaseShooterSpeed
.whenPressed(new DecreaseShootingSpeed());
81 changeCam
= new JoystickButton(rightJoystick
,
82 Constants
.OI
.CHANGE_CAMERA_VIEW
);
83 changeCam
.toggleWhenPressed(new ChangeCameraView());
85 togglePiston
= new JoystickButton(rightJoystick
,
86 Constants
.Shooter
.TOGGLE_INDEXER
);
87 togglePiston
.whenPressed(new ToggleIndexerPiston());
89 toggleDriveTrainPiston
= new JoystickButton(rightJoystick
,
90 Constants
.DriveTrain
.TOGGLE_DRIVE_PISTON
);
91 toggleDriveTrainPiston
.whenPressed(new ToggleGear());
93 brakeCANTalons
= new JoystickButton(rightJoystick
,
94 Constants
.OI
.BRAKE_CANTALONS_PORT
);
95 brakeCANTalons
.whenPressed(new BrakeCANTalons());
97 coastCANTalons
= new JoystickButton(rightJoystick
,
98 Constants
.OI
.COAST_CANTALONS_PORT
);
99 coastCANTalons
.whenPressed(new CoastCANTalons());
102 public static OI
getOI() {
109 * @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() ==
110 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
111 * Robot.getShooter().runIndexWheel(); } }
113 * @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() ==
114 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
115 * Robot.getShooter().stopIndexWheel(); } }
117 * @Override public void keyTyped(KeyEvent e) { }