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 | |
38a404b3 | 35 | public OI() { |
81787801 | 36 | System.out.println("OI is open"); |
38a404b3 KZ |
37 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); |
38 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
de8c65d3 SG |
39 | toggleWinch = new JoystickButton(leftJoystick, |
40 | Constants.OI.TOGGLE_WINCH_PORT); | |
2291f7b3 | 41 | toggleIndexWheel = new JoystickButton(leftJoystick, |
42 | Constants.OI.TOGGLE_INDEXWHEEL_PORT); | |
43 | toggleFlyWheel = new JoystickButton(leftJoystick, | |
44 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
81787801 T |
45 | toggleIntake = new JoystickButton(leftJoystick, |
46 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
47 | toggleReverseIntake = new JoystickButton(leftJoystick, | |
48 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
49 | toggleHighGear = new JoystickButton(leftJoystick, | |
50 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
51 | toggleNormalGear = new JoystickButton(leftJoystick, | |
52 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
53 | increaseShootSpeed = new JoystickButton(leftJoystick, | |
54 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
55 | decreaseShootSpeed = new JoystickButton(leftJoystick, | |
56 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
57 | turn90Right = new JoystickButton(leftJoystick, | |
58 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
59 | turn90Left = new JoystickButton(leftJoystick, | |
60 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
61 | readyShooter = new JoystickButton(leftJoystick, | |
62 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
63 | shootButton = new JoystickButton(leftJoystick, | |
64 | Constants.OI.TOGGLE_FLYWHEEL_PORT); | |
65 | ||
66 | toggleIndexWheel.whenPressed(new RunIndexWheelContinuous(1)); | |
67 | toggleHighGear.whenPressed(new ToggleGear()); | |
68 | toggleNormalGear.whenPressed(new ToggleGear()); | |
69 | increaseShootSpeed.whenPressed(new IncreaseShootingSpeed()); | |
70 | decreaseShootSpeed.whenPressed(new DecreaseShootingSpeed()); | |
71 | turn90Right.whenPressed(new Turn90Right()); | |
72 | turn90Left.whenPressed(new Turn90Left()); | |
73 | readyShooter.whenPressed(new PrepareToShoot()); | |
74 | shootButton.whenPressed(new Shoot()); | |
38a404b3 | 75 | } |
cf086549 SG |
76 | |
77 | public static OI getOI() { | |
78 | if (oi == null) | |
79 | oi = new OI(); | |
80 | return oi; | |
cca02549 | 81 | } |
38a404b3 | 82 | } |