From c14b294395bae8232ecfb4a95eec43722b00cab2 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Tue, 20 Feb 2024 18:52:44 -0500 Subject: [PATCH] --- src/main/java/frc/robot/RobotContainer.java | 9 ++++++--- src/main/java/frc/robot/subsystem/LED.java | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index aca3472..881999f 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -8,6 +8,7 @@ import com.pathplanner.lib.auto.AutoBuilder; import com.pathplanner.lib.auto.NamedCommands; import edu.wpi.first.cameraserver.CameraServer; import edu.wpi.first.math.MathUtil; +import edu.wpi.first.wpilibj.Relay; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; @@ -56,9 +57,11 @@ public class RobotContainer { Lanceur lanceur = new Lanceur(); Limelight limelight = new Limelight(); LED LED = new LED(); - CommandJoystick joystick = new CommandJoystick(0); - CommandXboxController manette = new CommandXboxController(1); - + CommandJoystick joystick = new CommandJoystick(0); + CommandXboxController manette = new CommandXboxController(1); + /*private final Relay blue = new Relay(0); + private final Relay rouge = new Relay(1); + private final Relay vert = new Relay(2);*/ //command PistonFerme pistonFerme = new PistonFerme(grimpeur); Balayer balayer = new Balayer(balayeuse, accumulateur); diff --git a/src/main/java/frc/robot/subsystem/LED.java b/src/main/java/frc/robot/subsystem/LED.java index dc7a60b..d3e9e76 100644 --- a/src/main/java/frc/robot/subsystem/LED.java +++ b/src/main/java/frc/robot/subsystem/LED.java @@ -6,13 +6,16 @@ package frc.robot.subsystem; import edu.wpi.first.wpilibj.AddressableLED; import edu.wpi.first.wpilibj.AddressableLEDBuffer; +import edu.wpi.first.wpilibj.Relay; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class LED extends SubsystemBase { /** Creates a new LED. */ public LED() {} + AddressableLED led = new AddressableLED(9); AddressableLEDBuffer ledBuffer = new AddressableLEDBuffer(150); + public void led(){ led.setData(ledBuffer); led.start();} @@ -21,10 +24,7 @@ public class LED extends SubsystemBase { for (int i = 0; i < ledBuffer.getLength(); i++) { // Sets the specified LED to the RGB values for red ledBuffer.setRGB(i, 255, 0, 0);} - - } - - + } @Override public void periodic() { // This method will be called once per scheduler run