Add button handling for shooter commands
authorKevin Zhang <icestormf1@gmail.com>
Sat, 23 Jan 2016 03:00:02 +0000 (19:00 -0800)
committerKevin Zhang <icestormf1@gmail.com>
Sat, 23 Jan 2016 03:37:35 +0000 (19:37 -0800)
src/org/usfirst/frc/team3501/robot/OI.java

index 5322f36255843eda81a4ac4e63b2f68ffb5b5b4b..17889c7073c21796465fa0294b3c3f057a7ec139 100644 (file)
@@ -1,5 +1,8 @@
 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;
@@ -18,15 +21,18 @@ public class OI {
 
     decrementShooterSpeed = new JoystickButton(rightJoystick,
         Constants.OI.DEC_SHOOTER_SPD_PORT);
+    decrementShooterSpeed.whenPressed(new ChangeShooterSpeed(-0.1));
 
     incrementShooterSpeed = new JoystickButton(rightJoystick,
         Constants.OI.INC_SHOOTER_SPD_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));
 
   }
-
 }