fix joystick port
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / OI.java
CommitLineData
38a404b3
KZ
1package org.usfirst.frc.team3501.robot;
2
9dc69158 3import org.usfirst.frc.team3501.robot.commands.climber.ToggleWinch;
7935bf26 4import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
cef1f36d
RR
5import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous;
6import org.usfirst.frc.team3501.robot.commands.intake.RunIntakeContinuous;
5e93f308
CZ
7import org.usfirst.frc.team3501.robot.commands.shooter.DecreaseShootingSpeed;
8import org.usfirst.frc.team3501.robot.commands.shooter.IncreaseShootingSpeed;
cef1f36d
RR
9import org.usfirst.frc.team3501.robot.commands.shooter.ReverseIndexWheelContinuous;
10import org.usfirst.frc.team3501.robot.commands.shooter.RunFlyWheelContinuous;
11import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous;
7935bf26 12
38a404b3 13import edu.wpi.first.wpilibj.Joystick;
de8c65d3
SG
14import edu.wpi.first.wpilibj.buttons.Button;
15import edu.wpi.first.wpilibj.buttons.JoystickButton;
38a404b3
KZ
16
17public class OI {
cca02549 18 private static OI oi;
38a404b3
KZ
19 public static Joystick leftJoystick;
20 public static Joystick rightJoystick;
83fa645c 21 public static Button toggleWinch;
38a404b3 22
cef1f36d
RR
23 public static Button runIndexWheel;
24 public static Button reverseIndexWheel;
2291f7b3 25 public static Button toggleFlyWheel;
26
7935bf26
AD
27 public static Button toggleGear;
28
cef1f36d
RR
29 public static Button runIntake;
30 public static Button reverseIntake;
31
5e93f308
CZ
32 public static Button increaseShooterSpeed;
33 public static Button decreaseShooterSpeed;
34
38a404b3
KZ
35 public OI() {
36 leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
37 rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
cef1f36d 38
5e93f308
CZ
39 runIndexWheel = new JoystickButton(rightJoystick,
40 Constants.OI.RUN_INDEXWHEEL_PORT);
cef1f36d
RR
41 runIndexWheel.whileHeld(new RunIndexWheelContinuous());
42
aec45ad9 43 reverseIndexWheel = new JoystickButton(rightJoystick,
cef1f36d
RR
44 Constants.OI.REVERSE_INDEXWHEEL_PORT);
45 reverseIndexWheel.whileHeld(new ReverseIndexWheelContinuous());
46
5e93f308 47 toggleFlyWheel = new JoystickButton(rightJoystick,
2291f7b3 48 Constants.OI.TOGGLE_FLYWHEEL_PORT);
cef1f36d
RR
49 toggleFlyWheel.toggleWhenPressed(new RunFlyWheelContinuous());
50
7935bf26
AD
51 toggleGear = new JoystickButton(leftJoystick,
52 Constants.OI.TOGGLE_GEAR_PORT);
53 toggleGear.whenPressed(new ToggleGear());
cef1f36d 54
aec45ad9 55 runIntake = new JoystickButton(leftJoystick, Constants.OI.RUN_INTAKE_PORT);
cef1f36d
RR
56 runIntake.whileHeld(new RunIntakeContinuous());
57
58 reverseIntake = new JoystickButton(leftJoystick,
59 Constants.OI.REVERSE_INTAKE_PORT);
60 reverseIntake.whileHeld(new ReverseIntakeContinuous());
61
62 toggleWinch = new JoystickButton(leftJoystick,
63 Constants.OI.TOGGLE_WINCH_PORT);
25ef99e6 64 toggleWinch.whenPressed(new ToggleWinch());
5e93f308
CZ
65
66 increaseShooterSpeed = new JoystickButton(leftJoystick,
67 Constants.OI.INCREASE_SHOOTER_SPEED_PORT);
68 increaseShooterSpeed.whenPressed(new IncreaseShootingSpeed());
69
70 decreaseShooterSpeed = new JoystickButton(leftJoystick,
71 Constants.OI.DECREASE_SHOOTER_SPEED_PORT);
72 decreaseShooterSpeed.whenPressed(new DecreaseShootingSpeed());
38a404b3 73 }
cf086549
SG
74
75 public static OI getOI() {
76 if (oi == null)
77 oi = new OI();
78 return oi;
cca02549 79 }
38a404b3 80}