From 37e5a1215ef4909e720304e619667d40492dfaf1 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Fri, 22 Jan 2016 19:00:02 -0800 Subject: [PATCH] Add button handling for shooter commands --- src/org/usfirst/frc/team3501/robot/OI.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/org/usfirst/frc/team3501/robot/OI.java b/src/org/usfirst/frc/team3501/robot/OI.java index 5322f362..17889c70 100644 --- a/src/org/usfirst/frc/team3501/robot/OI.java +++ b/src/org/usfirst/frc/team3501/robot/OI.java @@ -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)); } - } -- 2.30.2