mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal, wpilib] Update Addressable LED support (#8100)
This commit is contained in:
@@ -31,19 +31,16 @@ public class Robot extends TimedRobot {
|
||||
|
||||
/** Called once at the beginning of the robot program. */
|
||||
public Robot() {
|
||||
// PWM port 9
|
||||
// Must be a PWM header, not MXP or DIO
|
||||
m_led = new AddressableLED(9);
|
||||
// SmartIO port 1
|
||||
m_led = new AddressableLED(1);
|
||||
|
||||
// Reuse buffer
|
||||
// Default to a length of 60, start empty output
|
||||
// Length is expensive to set, so only set it once, then just update data
|
||||
// Default to a length of 60
|
||||
m_ledBuffer = new AddressableLEDBuffer(60);
|
||||
m_led.setLength(m_ledBuffer.getLength());
|
||||
|
||||
// Set the data
|
||||
m_led.setData(m_ledBuffer);
|
||||
m_led.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user