| 1 | package org.usfirst.frc.team3501.robot; |
| 2 | |
| 3 | import org.usfirst.frc.team3501.robot.commands.shooter.ChangeShooterSpeed; |
| 4 | import org.usfirst.frc.team3501.robot.commands.shooter.SetShooterSpeed; |
| 5 | |
| 6 | import edu.wpi.first.wpilibj.Joystick; |
| 7 | import edu.wpi.first.wpilibj.buttons.Button; |
| 8 | import edu.wpi.first.wpilibj.buttons.JoystickButton; |
| 9 | |
| 10 | public class OI { |
| 11 | public static Joystick leftJoystick; |
| 12 | public static Joystick rightJoystick; |
| 13 | public static Button decrementShooterSpeed; |
| 14 | public static Button incrementShooterSpeed; |
| 15 | public static Button outputCurrentShooterSpeed; |
| 16 | public static Button trigger; |
| 17 | |
| 18 | public OI() { |
| 19 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); |
| 20 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); |
| 21 | |
| 22 | decrementShooterSpeed = new JoystickButton(rightJoystick, |
| 23 | Constants.OI.DECREMENT_SHOOTER_SPEED_PORT); |
| 24 | decrementShooterSpeed.whenPressed(new ChangeShooterSpeed(-0.1)); |
| 25 | |
| 26 | incrementShooterSpeed = new JoystickButton(rightJoystick, |
| 27 | Constants.OI.INCREMENT_SHOOTER_SPEED_PORT); |
| 28 | incrementShooterSpeed.whenPressed(new ChangeShooterSpeed(0.1)); |
| 29 | |
| 30 | outputCurrentShooterSpeed = new JoystickButton(rightJoystick, |
| 31 | Constants.OI.SHOOT_PORT); |
| 32 | |
| 33 | trigger = new JoystickButton(rightJoystick, Constants.OI.TRIGGER_PORT); |
| 34 | trigger.whenPressed(new SetShooterSpeed(0.5)); |
| 35 | trigger.whenReleased(new SetShooterSpeed(0.0)); |
| 36 | |
| 37 | } |
| 38 | } |