fixed a few errors
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / OI.java
CommitLineData
38a404b3
KZ
1package org.usfirst.frc.team3501.robot;
2
81787801
T
3import org.usfirst.frc.team3501.robot.commandgroups.PrepareToShoot;
4import org.usfirst.frc.team3501.robot.commandgroups.Shoot;
5import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
6import org.usfirst.frc.team3501.robot.commands.driving.Turn90Left;
7import org.usfirst.frc.team3501.robot.commands.driving.Turn90Right;
8import org.usfirst.frc.team3501.robot.commands.shooter.DecreaseShootingSpeed;
622d3406
T
9import org.usfirst.frc.team3501.robot.commands.shooter.IncreaseShootingSpeed;
10import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous;
81787801 11
38a404b3 12import edu.wpi.first.wpilibj.Joystick;
de8c65d3
SG
13import edu.wpi.first.wpilibj.buttons.Button;
14import edu.wpi.first.wpilibj.buttons.JoystickButton;
38a404b3
KZ
15
16public class OI {
cca02549 17 private static OI oi;
38a404b3
KZ
18 public static Joystick leftJoystick;
19 public static Joystick rightJoystick;
81787801 20 public static Button toggleWinch;
2291f7b3 21 public static Button toggleIndexWheel;
22 public static Button toggleFlyWheel;
81787801
T
23 public static Button toggleIntake;
24 public static Button toggleReverseIntake;
25 public static Button toggleHighGear;
26 public static Button toggleNormalGear;
27 public static Button increaseShootSpeed;
28 public static Button decreaseShootSpeed;
29 public static Button turn90Right;
30 public static Button turn90Left;
31 public static Button readyShooter;
32 public static Button shootButton;
2291f7b3 33
38a404b3 34 public OI() {
81787801 35 System.out.println("OI is open");
38a404b3
KZ
36 leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
37 rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
de8c65d3
SG
38 toggleWinch = new JoystickButton(leftJoystick,
39 Constants.OI.TOGGLE_WINCH_PORT);
6f28f1e7 40
2291f7b3 41 toggleIndexWheel = new JoystickButton(leftJoystick,
42 Constants.OI.TOGGLE_INDEXWHEEL_PORT);
43 toggleFlyWheel = new JoystickButton(leftJoystick,
44 Constants.OI.TOGGLE_FLYWHEEL_PORT);
9dcc48a1 45
81787801
T
46 toggleIntake = new JoystickButton(leftJoystick,
47 Constants.OI.TOGGLE_FLYWHEEL_PORT);
48 toggleReverseIntake = new JoystickButton(leftJoystick,
49 Constants.OI.TOGGLE_FLYWHEEL_PORT);
50 toggleHighGear = new JoystickButton(leftJoystick,
51 Constants.OI.TOGGLE_FLYWHEEL_PORT);
52 toggleNormalGear = new JoystickButton(leftJoystick,
53 Constants.OI.TOGGLE_FLYWHEEL_PORT);
54 increaseShootSpeed = new JoystickButton(leftJoystick,
55 Constants.OI.TOGGLE_FLYWHEEL_PORT);
56 decreaseShootSpeed = new JoystickButton(leftJoystick,
57 Constants.OI.TOGGLE_FLYWHEEL_PORT);
58 turn90Right = new JoystickButton(leftJoystick,
59 Constants.OI.TOGGLE_FLYWHEEL_PORT);
60 turn90Left = new JoystickButton(leftJoystick,
61 Constants.OI.TOGGLE_FLYWHEEL_PORT);
62 readyShooter = new JoystickButton(leftJoystick,
63 Constants.OI.TOGGLE_FLYWHEEL_PORT);
64 shootButton = new JoystickButton(leftJoystick,
65 Constants.OI.TOGGLE_FLYWHEEL_PORT);
66
67 toggleIndexWheel.whenPressed(new RunIndexWheelContinuous(1));
68 toggleHighGear.whenPressed(new ToggleGear());
69 toggleNormalGear.whenPressed(new ToggleGear());
70 increaseShootSpeed.whenPressed(new IncreaseShootingSpeed());
71 decreaseShootSpeed.whenPressed(new DecreaseShootingSpeed());
72 turn90Right.whenPressed(new Turn90Right());
73 turn90Left.whenPressed(new Turn90Left());
74 readyShooter.whenPressed(new PrepareToShoot());
75 shootButton.whenPressed(new Shoot());
9dcc48a1 76
38a404b3 77 }
cf086549
SG
78
79 public static OI getOI() {
80 if (oi == null)
81 oi = new OI();
82 return oi;
cca02549 83 }
38a404b3 84}