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
;
6 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ToggleGear
;
7 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.ReverseIntakeContinuous
;
8 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.RunIntakeContinuous
;
9 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.DecreaseShootingSpeed
;
10 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.IncreaseShootingSpeed
;
11 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.ReverseIndexWheelContinuous
;
12 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunFlyWheelContinuous
;
13 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunIndexWheelContinuous
;
14 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.ToggleIndexerPiston
;
15 import org
.usfirst
.frc
.team3501
.robot
.utils
.ChangeCameraView
;
17 import edu
.wpi
.first
.wpilibj
.Joystick
;
18 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
19 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
21 public class OI
/* implements KeyListener */ {
23 public static Joystick leftJoystick
;
24 public static Joystick rightJoystick
;
26 public static Button runIndexWheel
;
27 public static Button reverseIndexWheel
;
28 public static Button toggleFlyWheel
;
30 public static Button toggleGear
;
32 public static Button runIntake
;
33 public static Button reverseIntake
;
35 public static Button increaseShooterSpeed
;
36 public static Button decreaseShooterSpeed
;
38 private static Button changeCam
;
40 private static Button togglePiston
;
41 private static Button toggleDriveTrainPiston
;
43 public static Button brakeCANTalons
;
44 public static Button coastCANTalons
;
48 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
49 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
51 runIndexWheel
= new JoystickButton(rightJoystick
,
52 Constants
.OI
.RUN_INDEXWHEEL_PORT
);
53 runIndexWheel
.whileHeld(new RunIndexWheelContinuous());
55 reverseIndexWheel
= new JoystickButton(rightJoystick
,
56 Constants
.OI
.REVERSE_INDEXWHEEL_PORT
);
57 reverseIndexWheel
.whileHeld(new ReverseIndexWheelContinuous());
59 toggleFlyWheel
= new JoystickButton(rightJoystick
,
60 Constants
.OI
.TOGGLE_FLYWHEEL_PORT
);
61 toggleFlyWheel
.toggleWhenPressed(new RunFlyWheelContinuous());
63 toggleGear
= new JoystickButton(leftJoystick
,
64 Constants
.OI
.TOGGLE_GEAR_PORT
);
65 toggleGear
.whenPressed(new ToggleGear());
67 runIntake
= new JoystickButton(leftJoystick
, Constants
.OI
.RUN_INTAKE_PORT
);
68 runIntake
.whileHeld(new RunIntakeContinuous());
70 reverseIntake
= new JoystickButton(leftJoystick
,
71 Constants
.OI
.REVERSE_INTAKE_PORT
);
72 reverseIntake
.whileHeld(new ReverseIntakeContinuous());
74 increaseShooterSpeed
= new JoystickButton(leftJoystick
,
75 Constants
.OI
.INCREASE_SHOOTER_SPEED_PORT
);
76 increaseShooterSpeed
.whenPressed(new IncreaseShootingSpeed());
78 decreaseShooterSpeed
= new JoystickButton(leftJoystick
,
79 Constants
.OI
.DECREASE_SHOOTER_SPEED_PORT
);
80 decreaseShooterSpeed
.whenPressed(new DecreaseShootingSpeed());
82 changeCam
= new JoystickButton(rightJoystick
,
83 Constants
.OI
.CHANGE_CAMERA_VIEW
);
84 changeCam
.toggleWhenPressed(new ChangeCameraView());
86 togglePiston
= new JoystickButton(rightJoystick
,
87 Constants
.Shooter
.TOGGLE_INDEXER
);
88 togglePiston
.toggleWhenPressed(new ToggleIndexerPiston());
90 toggleDriveTrainPiston
= new JoystickButton(rightJoystick
,
91 Constants
.DriveTrain
.TOGGLE_DRIVE_PISTON
);
92 toggleDriveTrainPiston
.whenPressed(new ToggleGear());
94 brakeCANTalons
= new JoystickButton(rightJoystick
,
95 Constants
.OI
.BRAKE_CANTALONS_PORT
);
96 brakeCANTalons
.whenPressed(new BrakeCANTalons());
98 coastCANTalons
= new JoystickButton(rightJoystick
,
99 Constants
.OI
.COAST_CANTALONS_PORT
);
100 coastCANTalons
.whenPressed(new CoastCANTalons());
103 public static OI
getOI() {
110 * @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() ==
111 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
112 * Robot.getShooter().runIndexWheel(); } }
114 * @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() ==
115 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
116 * Robot.getShooter().stopIndexWheel(); } }
118 * @Override public void keyTyped(KeyEvent e) { }