led
This commit is contained in:
27
src/main/java/frc/robot/subsystem/LED.java
Normal file
27
src/main/java/frc/robot/subsystem/LED.java
Normal file
@ -0,0 +1,27 @@
|
||||
// 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.wpilibj2.command.SubsystemBase;
|
||||
|
||||
public class LED extends SubsystemBase {
|
||||
/** Creates a new LED. */
|
||||
public LED() {}
|
||||
AddressableLED led = new AddressableLED(9);
|
||||
AddressableLEDBuffer ledBuffer = new AddressableLEDBuffer(60);
|
||||
public void led(){
|
||||
led.setData(ledBuffer);
|
||||
led.start();
|
||||
}
|
||||
public void couleur(int R, int G, int B){
|
||||
ledBuffer.setRGB(0, R, G, B);
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user