Add code for alternating the camera feed
[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
ee1a8006
RR
35 private static Button changeCam;
36
38a404b3
KZ
37 public OI() {
38 leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
39 rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
cef1f36d 40
5e93f308
CZ
41 runIndexWheel = new JoystickButton(rightJoystick,
42 Constants.OI.RUN_INDEXWHEEL_PORT);
cef1f36d
RR
43 runIndexWheel.whileHeld(new RunIndexWheelContinuous());
44
aec45ad9 45 reverseIndexWheel = new JoystickButton(rightJoystick,
cef1f36d
RR
46 Constants.OI.REVERSE_INDEXWHEEL_PORT);
47 reverseIndexWheel.whileHeld(new ReverseIndexWheelContinuous());
48
5e93f308 49 toggleFlyWheel = new JoystickButton(rightJoystick,
2291f7b3 50 Constants.OI.TOGGLE_FLYWHEEL_PORT);
cef1f36d
RR
51 toggleFlyWheel.toggleWhenPressed(new RunFlyWheelContinuous());
52
7935bf26
AD
53 toggleGear = new JoystickButton(leftJoystick,
54 Constants.OI.TOGGLE_GEAR_PORT);
55 toggleGear.whenPressed(new ToggleGear());
cef1f36d 56
aec45ad9 57 runIntake = new JoystickButton(leftJoystick, Constants.OI.RUN_INTAKE_PORT);
cef1f36d
RR
58 runIntake.whileHeld(new RunIntakeContinuous());
59
60 reverseIntake = new JoystickButton(leftJoystick,
61 Constants.OI.REVERSE_INTAKE_PORT);
62 reverseIntake.whileHeld(new ReverseIntakeContinuous());
63
64 toggleWinch = new JoystickButton(leftJoystick,
65 Constants.OI.TOGGLE_WINCH_PORT);
25ef99e6 66 toggleWinch.whenPressed(new ToggleWinch());
5e93f308
CZ
67
68 increaseShooterSpeed = new JoystickButton(leftJoystick,
69 Constants.OI.INCREASE_SHOOTER_SPEED_PORT);
70 increaseShooterSpeed.whenPressed(new IncreaseShootingSpeed());
71
72 decreaseShooterSpeed = new JoystickButton(leftJoystick,
73 Constants.OI.DECREASE_SHOOTER_SPEED_PORT);
74 decreaseShooterSpeed.whenPressed(new DecreaseShootingSpeed());
ee1a8006
RR
75
76 changeCam = new JoystickButton(rightJoystick,
77 Constants.OI.CHANGE_CAMERA_VIEW);
78 changeCam.toggleWhenPressed(new ChangeCameraView());
38a404b3 79 }
cf086549
SG
80
81 public static OI getOI() {
82 if (oi == null)
83 oi = new OI();
84 return oi;
cca02549 85 }
38a404b3 86}