Hi guys, I’m doing a project for school where i’m required to use a Raspberry Pi. Are there any FastLED alternatives/libraries that i could use to control WS2812 LED strips or is a FadeCandy the only way to use LED strips with a Raspberry Pi?
https://learn.adafruit.com/neopixels-on-raspberry-pi/overview I’ve never used it myself but it looks like it’ll allow you to accomplish your goal.
If you’re using a pi, you really want to be using FadeCandy to drive the leds if you’re using WS2812’s - while the pi is a much faster platform than the MCUs that FastLED runs on ,the WS2812 leds are still slow - so you will want to write led data out in parallel if you have more than 100-200 leds.
OK, so a fadecandy it is. They might be ws2812B, I’ll post a link of where I got them later. Does led speed really matter that much? For my uses I’ve never had any problems.
@Michal_Hipner Whether you run into problems depends on the size of your array.
The data rate for WS2812 pixels is 800kHz (i.e. 800,000 bits per second). This represents 100,000 bytes per second. Since each pixel needs a 3-byte value for its colour, that means you can update 33333 pixels once per second, or 1111 pixels 30 times per second.
This leaves zero time whatsoever for the CPU to actually calculate what those colours should be, so if you want to use 50% of the CPU time for that and still update at 30 frames per second, the maximum count of LEDs halves (you’re now down to 555 pixels).
If you push out updates to eight strips in parallel, the maximum number of LEDs increases by a factor of 8 (now you can use half your CPU time to do Fancy Math™ and still update 4444 pixels at 30fps).