Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
81787801 T |
3 | import org.usfirst.frc.team3501.robot.commandgroups.PrepareToShoot; |
4 | import org.usfirst.frc.team3501.robot.commandgroups.Shoot; | |
5 | import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear; | |
6 | import org.usfirst.frc.team3501.robot.commands.driving.Turn90Left; | |
7 | import org.usfirst.frc.team3501.robot.commands.driving.Turn90Right; | |
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.RunIndexWheelContinuous; | |
11 | ||
38a404b3 | 12 | import edu.wpi.first.wpilibj.Joystick; |
de8c65d3 SG |
13 | import edu.wpi.first.wpilibj.buttons.Button; |
14 | import edu.wpi.first.wpilibj.buttons.JoystickButton; | |
38a404b3 KZ |
15 | |
16 | public class OI { | |
cca02549 | 17 | private static OI oi; |
38a404b3 KZ |
18 | public static Joystick leftJoystick; |
19 | public static Joystick rightJoystick; | |
20 | ||
81787801 | 21 | public static Button toggleWinch; |
2291f7b3 | 22 | public static Button toggleIndexWheel; |
23 | public static Button toggleFlyWheel; | |
81787801 T |
24 | public static Button toggleIntake; |
25 | public static Button toggleReverseIntake; | |
26 | public static Button toggleHighGear; | |
27 | public static Button toggleNormalGear; | |
28 | public static Button increaseShootSpeed; | |
29 | public static Button decreaseShootSpeed; | |
30 | public static Button turn90Right; | |
31 | public static Button turn90Left; | |
32 | public static Button readyShooter; | |
33 | public static Button shootButton; | |
2291f7b3 | 34 | |
7935bf26 AD |
35 | public static Button toggleGear; |
36 | ||
38a404b3 | 37 | public OI() { |
81787801 | 38 | System.out.println("OI is open"); |
38a404b3 KZ |
39 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); |
40 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
de8c65d3 SG |
41 | toggleWinch = new JoystickButton(leftJoystick, |
42 | Constants.OI.TOGGLE_WINCH_PORT); | |
2291f7b3 | 43 | toggleIndexWheel = new JoystickButton(leftJoystick, |
44 | Constants.OI.TOGGLE_INDEXWHEEL_PORT); | |
45 | toggleFlyWheel = new JoystickButton(leftJoystick, | |
46 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
81787801 T |
47 | toggleIntake = new JoystickButton(leftJoystick, |
48 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
49 | toggleReverseIntake = new JoystickButton(leftJoystick, | |
50 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
51 | toggleHighGear = new JoystickButton(leftJoystick, | |
52 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
53 | toggleNormalGear = new JoystickButton(leftJoystick, | |
54 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
55 | increaseShootSpeed = new JoystickButton(leftJoystick, | |
56 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
57 | decreaseShootSpeed = new JoystickButton(leftJoystick, | |
58 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
59 | turn90Right = new JoystickButton(leftJoystick, | |
60 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
61 | turn90Left = new JoystickButton(leftJoystick, | |
62 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
63 | readyShooter = new JoystickButton(leftJoystick, | |
64 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
65 | shootButton = new JoystickButton(leftJoystick, | |
66 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
67 | ||
68 | toggleIndexWheel.whenPressed(new RunIndexWheelContinuous(1)); | |
69 | toggleHighGear.whenPressed(new ToggleGear()); | |
70 | toggleNormalGear.whenPressed(new ToggleGear()); | |
71 | increaseShootSpeed.whenPressed(new IncreaseShootingSpeed()); | |
72 | decreaseShootSpeed.whenPressed(new DecreaseShootingSpeed()); | |
73 | turn90Right.whenPressed(new Turn90Right()); | |
74 | turn90Left.whenPressed(new Turn90Left()); | |
75 | readyShooter.whenPressed(new PrepareToShoot()); | |
76 | shootButton.whenPressed(new Shoot()); | |
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 | } |