which ws2811 library for simple status light?

Status
Not open for further replies.

hunter10

Member
Greets,

I'm using a small number of ws2811 LEDs as status lights in a box. Solid Green = good, flashing red = bad. That sort of simplicity. No animations, no fading.

These libraries seem intended for much more grand schemes. Is there a library that's unbloated enough for my needs, or am I better banging it out?


Many Thanks,
Hunter
 
You want the Adafruit neopixel library. It has support for the older ws2811 leds as well as the current generation ws2812/ws2812b, https://github.com/adafruit/Adafruit_NeoPixel. I recall that the ws2811 used the 400Khz data rate, and so you would use the NEO_KHZ400 in the setup argument instead of NEO_KHZ800.

In order to do flashing, you will have to manually turn on the led, and turn it off. For just a few lights, you might not need all of the best practices, but putting a resistor between the data pin and leds, and a capacitor on the power supply probably might help (I must be honest, and so far I haven't bothered with them): https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices
 
Obviously, I was mis-remembering the difference between WS2811 and WS2812. It is good it is working for you. Now, if you are trying to light hundreds of lights, then you would want to use octows2811 or fastled.

Note, if you are depending on accurate fast interrupts for keeping track of encoders or handling stepper/servo motors, I believe the Adafruit library turns off interrupts when it is doing the show action, and the interrupts would be delayed until after all of the lights are handled.
 
Status
Not open for further replies.
Back
Top