I’m trying to use the AddressableLED method to control the LEDs, but it isn’t working and I don’t know why. Here’s my code:
public void init()
{
ledStrip = new AddressableLED(4);
buffer = new AddressableLEDBuffer(4);
ledStrip.setLength(buffer.getLength());
ledStrip.setData(buffer);
ledStrip.start();
resetState();
}
public void update()
{
for (var i = 0; i < buffer.getLength(); i++) {
buffer.setRGB(i, 255, 0, 0);
}
ledStrip.setData(buffer);
}
We’re using PWM port 4 with 4 NeoPixel LEDs. Here’s a link to our reference code:
https://docs.wpilib.org/en/latest/docs/software/actuators/addressable-leds.html#