1 package org
.usfirst
.frc
.team3501
.robot
;
3 import java
.awt
.event
.KeyAdapter
;
4 import java
.awt
.event
.KeyEvent
;
6 import javax
.swing
.JButton
;
8 import org
.usfirst
.frc
.team3501
.robot
.commands
.climber
.ToggleWinch
;
9 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ToggleGear
;
10 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.ReverseIntakeContinuous
;
11 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.RunIntakeContinuous
;
12 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.DecreaseShootingSpeed
;
13 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.IncreaseShootingSpeed
;
14 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.ReverseIndexWheelContinuous
;
15 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunFlyWheelContinuous
;
16 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunIndexWheelContinuous
;
18 import edu
.wpi
.first
.wpilibj
.Joystick
;
19 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
20 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
24 public static Joystick leftJoystick
;
25 public static Joystick rightJoystick
;
26 public static Button toggleWinch
;
28 public static Button runIndexWheel
;
29 public static Button reverseIndexWheel
;
30 // public static Button toggleFlyWheel;
31 public static JButton toggleFlyWheel
;
33 public static Button toggleGear
;
35 public static Button runIntake
;
36 public static Button reverseIntake
;
38 public static Button increaseShooterSpeed
;
39 public static Button decreaseShooterSpeed
;
41 // private static Key a;
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());
56 * toggleFlyWheel = new JoystickButton(rightJoystick,
57 * Constants.OI.TOGGLE_FLYWHEEL_PORT); toggleFlyWheel.toggleWhenPressed(new
58 * RunFlyWheelContinuous());
61 toggleFlyWheel
= new JButton();
62 toggleFlyWheel
.addKeyListener(new KeyAdapter() {
63 RunFlyWheelContinuous runflywheel
= new RunFlyWheelContinuous();
66 * Starts the run index wheel continuous function
69 public void keyPressed(KeyEvent e
) {
70 if (e
.getKeyCode() == KeyEvent
.VK_0
) {
76 * Ends the run index wheel continuous function
79 public void keyReleased(KeyEvent e
) {
80 if (e
.getKeyCode() == KeyEvent
.VK_0
) {
87 toggleGear
= new JoystickButton(leftJoystick
,
88 Constants
.OI
.TOGGLE_GEAR_PORT
);
89 toggleGear
.whenPressed(new ToggleGear());
91 runIntake
= new JoystickButton(leftJoystick
, Constants
.OI
.RUN_INTAKE_PORT
);
92 runIntake
.whileHeld(new RunIntakeContinuous());
94 reverseIntake
= new JoystickButton(leftJoystick
,
95 Constants
.OI
.REVERSE_INTAKE_PORT
);
96 reverseIntake
.whileHeld(new ReverseIntakeContinuous());
98 toggleWinch
= new JoystickButton(leftJoystick
,
99 Constants
.OI
.TOGGLE_WINCH_PORT
);
100 toggleWinch
.whenPressed(new ToggleWinch());
102 increaseShooterSpeed
= new JoystickButton(leftJoystick
,
103 Constants
.OI
.INCREASE_SHOOTER_SPEED_PORT
);
104 increaseShooterSpeed
.whenPressed(new IncreaseShootingSpeed());
106 decreaseShooterSpeed
= new JoystickButton(leftJoystick
,
107 Constants
.OI
.DECREASE_SHOOTER_SPEED_PORT
);
108 decreaseShooterSpeed
.whenPressed(new DecreaseShootingSpeed());
111 public static OI
getOI() {