1 package org
.usfirst
.frc
.team3501
.robot
;
3 import org
.usfirst
.frc
.team3501
.robot
.commands
.climber
.ToggleWinch
;
4 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ToggleDrivePiston
;
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
;
15 import edu
.wpi
.first
.wpilibj
.Joystick
;
16 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
17 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
19 public class OI
/* implements KeyListener */ {
21 public static Joystick leftJoystick
;
22 public static Joystick rightJoystick
;
23 public static Button toggleWinch
;
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
;
44 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
45 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
47 runIndexWheel
= new JoystickButton(rightJoystick
,
48 Constants
.OI
.RUN_INDEXWHEEL_PORT
);
49 runIndexWheel
.whileHeld(new RunIndexWheelContinuous());
51 reverseIndexWheel
= new JoystickButton(rightJoystick
,
52 Constants
.OI
.REVERSE_INDEXWHEEL_PORT
);
53 reverseIndexWheel
.whileHeld(new ReverseIndexWheelContinuous());
55 toggleFlyWheel
= new JoystickButton(rightJoystick
,
56 Constants
.OI
.TOGGLE_FLYWHEEL_PORT
);
57 toggleFlyWheel
.toggleWhenPressed(new RunFlyWheelContinuous());
59 toggleGear
= new JoystickButton(leftJoystick
,
60 Constants
.OI
.TOGGLE_GEAR_PORT
);
61 toggleGear
.whenPressed(new ToggleGear());
63 runIntake
= new JoystickButton(leftJoystick
, Constants
.OI
.RUN_INTAKE_PORT
);
64 runIntake
.whileHeld(new RunIntakeContinuous());
66 reverseIntake
= new JoystickButton(leftJoystick
,
67 Constants
.OI
.REVERSE_INTAKE_PORT
);
68 reverseIntake
.whileHeld(new ReverseIntakeContinuous());
70 toggleWinch
= new JoystickButton(leftJoystick
,
71 Constants
.OI
.TOGGLE_WINCH_PORT
);
72 toggleWinch
.whenPressed(new ToggleWinch());
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());
83 * changeCam = new JoystickButton(rightJoystick,
84 * Constants.OI.CHANGE_CAMERA_VIEW); changeCam.toggleWhenPressed(new
85 * ChangeCameraView());
88 togglePiston
= new JoystickButton(rightJoystick
,
89 Constants
.Shooter
.TOGGLE_INDEXER
);
90 togglePiston
.whenPressed(new ToggleIndexerPiston());
92 toggleDriveTrainPiston
= new JoystickButton(rightJoystick
,
93 Constants
.DriveTrain
.TOGGLE_DRIVE_PISTON
);
94 toggleDriveTrainPiston
.whenPressed(new ToggleDrivePiston());
97 public static OI
getOI() {
104 * @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() ==
105 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
106 * Robot.getShooter().runIndexWheel(); } }
108 * @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() ==
109 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
110 * Robot.getShooter().stopIndexWheel(); } }
112 * @Override public void keyTyped(KeyEvent e) { }