From 1caadcc64caa160c084b0aeef53b0acc2c21f8c4 Mon Sep 17 00:00:00 2001 From: aarav18 Date: Sat, 14 Jan 2023 13:29:41 -0700 Subject: [PATCH] SwerveDrive RobotContainer + JoystickButtons done --- src/main/java/frc4388/robot/RobotContainer.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 02cd2b3..9674e56 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -49,6 +49,12 @@ public class RobotContainer { // drives the robot with a two-axis input from the driver controller // continually sends updates to the Blinkin LED controller to keep the lights on m_robotLED.setDefaultCommand(new RunCommand(() -> m_robotLED.updateLED(), m_robotLED)); + + m_robotSwerveDrive.setDefaultCommand( + new RunCommand(() -> m_robotSwerveDrive.driveWithInput(-getDriverController().getLeftXAxis(), + getDriverController().getLeftYAxis(), + -getDriverController().getRightXAxis(), false), m_robotSwerveDrive) + ); } /** @@ -64,8 +70,8 @@ public class RobotContainer { /* Operator Buttons */ // activates "Lit Mode" new JoystickButton(getOperatorJoystick(), XboxController.A_BUTTON) - .whenPressed(() -> m_robotLED.setPattern(LEDPatterns.LAVA_RAINBOW)) - .whenReleased(() -> m_robotLED.setPattern(LEDConstants.DEFAULT_PATTERN)); + .whileTrue(new RunCommand(() -> m_robotLED.setPattern(LEDPatterns.LAVA_RAINBOW))) + .whileFalse(new RunCommand(() -> m_robotLED.setPattern(LEDConstants.DEFAULT_PATTERN))); } /**