// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. 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();} public void couleur(int R, int G,int B){ 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 } }