Add button handling for shooter commands
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / OI.java
CommitLineData
38a404b3
KZ
1package org.usfirst.frc.team3501.robot;
2
37e5a121
KZ
3import org.usfirst.frc.team3501.robot.commands.ChangeShooterSpeed;
4import org.usfirst.frc.team3501.robot.commands.SetShooterSpeed;
5
38a404b3 6import edu.wpi.first.wpilibj.Joystick;
cb3389eb
E
7import edu.wpi.first.wpilibj.buttons.Button;
8import edu.wpi.first.wpilibj.buttons.JoystickButton;
38a404b3
KZ
9
10public class OI {
11 public static Joystick leftJoystick;
12 public static Joystick rightJoystick;
647e73b5
KZ
13 public static Button decrementShooterSpeed;
14 public static Button incrementShooterSpeed;
8a394843 15 public static Button outputCurrentShooterSpeed;
be737818 16 public static Button trigger;
38a404b3
KZ
17
18 public OI() {
19 leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
20 rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
21
647e73b5
KZ
22 decrementShooterSpeed = new JoystickButton(rightJoystick,
23 Constants.OI.DEC_SHOOTER_SPD_PORT);
37e5a121 24 decrementShooterSpeed.whenPressed(new ChangeShooterSpeed(-0.1));
cb3389eb 25
647e73b5
KZ
26 incrementShooterSpeed = new JoystickButton(rightJoystick,
27 Constants.OI.INC_SHOOTER_SPD_PORT);
37e5a121 28 incrementShooterSpeed.whenPressed(new ChangeShooterSpeed(0.1));
7a949394 29
8a394843 30 outputCurrentShooterSpeed = new JoystickButton(rightJoystick,
55504016 31 Constants.OI.SHOOT_PORT);
8a394843 32
be737818 33 trigger = new JoystickButton(rightJoystick, Constants.OI.TRIGGER_PORT);
37e5a121
KZ
34 trigger.whenPressed(new SetShooterSpeed(0.5));
35 trigger.whenReleased(new SetShooterSpeed(0.0));
be737818 36
38a404b3
KZ
37 }
38}