Trouble Connecting Roborio to Neopixels with AddressableLed

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#

1 Like

How are you powering the leds? If from the vrm, you also need a ground going directly to the Rio. Also, you connect the data in pin on the first led to the signal out pin on the roboRIO pwm port?

And you’re definitely calling update, right?