Change decrement/increment shooter port names to be more descriptive
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / OI.java
index 997be71cdbe551afe2477d093f6172a28c1cfe26..6b2f0510601f1531e70398e1f530cde5bcb3596e 100644 (file)
@@ -1,14 +1,38 @@
 package org.usfirst.frc.team3501.robot;
 
+import org.usfirst.frc.team3501.robot.commands.ChangeShooterSpeed;
+import org.usfirst.frc.team3501.robot.commands.SetShooterSpeed;
+
 import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.buttons.Button;
+import edu.wpi.first.wpilibj.buttons.JoystickButton;
 
 public class OI {
   public static Joystick leftJoystick;
   public static Joystick rightJoystick;
+  public static Button decrementShooterSpeed;
+  public static Button incrementShooterSpeed;
+  public static Button outputCurrentShooterSpeed;
+  public static Button trigger;
 
   public OI() {
     leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
     rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
 
+    decrementShooterSpeed = new JoystickButton(rightJoystick,
+        Constants.OI.DECREMENT_SHOOTER_SPEED_PORT);
+    decrementShooterSpeed.whenPressed(new ChangeShooterSpeed(-0.1));
+
+    incrementShooterSpeed = new JoystickButton(rightJoystick,
+        Constants.OI.INCREMENT_SHOOTER_SPEED_PORT);
+    incrementShooterSpeed.whenPressed(new ChangeShooterSpeed(0.1));
+
+    outputCurrentShooterSpeed = new JoystickButton(rightJoystick,
+        Constants.OI.SHOOT_PORT);
+
+    trigger = new JoystickButton(rightJoystick, Constants.OI.TRIGGER_PORT);
+    trigger.whenPressed(new SetShooterSpeed(0.5));
+    trigger.whenReleased(new SetShooterSpeed(0.0));
+
   }
 }