Starting to research libraries for controlling LED strips for my first big project and I seem to come across three major libraries for controlling the WS2812 chip that i will be purchasing. I am going to be driving 15 meters of LEDs (60 per meter for 900 total).
The first is Adafruits Neopixel. I am sure this is a very popular one because Adafruit aims to make stuff easy for beginners, but is it necessarily the best?
The FastSPI Library is a popular contender to the Neopixel. I am unsure on how they differ exactly, but it is supposedly faster?
OctoWS2811 is a cool one i saw that was able to drive a huge array of LEDs, i even read somewhere (i believe) that this library allows for Raspberry Pi and other similar devices to drive the LEDs, something that read previously was impossible due to the lack of very precise timing!
Can someone with more information on these libraries give me some insight? I am just a beginner looking to get into this crazy world of electronics!
Silman:
OctoWS2811 is a cool one I saw that was able to drive a huge array of LEDs, I even read somewhere (I believe) that this library allows for Raspberry Pi and other similar devices to drive the LEDs, something that read previously was impossible due to the lack of very precise timing!
It is all of that - except that it does not run on the Arduino, but instead the "Teensy" series of modules, which use different processors (but do use the Arduino IDE).
You have decided on the hardware so just write some test code to display the LED effects you want using all 3 libraries and decide what one best suits your needs and memory usage budget. When doing my first Arduino project I did tests with different libraries for driving the MAX7219 and then selected the one that best suited my need.
Paul__B:
It is all of that - except that it does not run on the Arduino, but instead the "Teensy" series of modules, which use different processors (but do use the Arduino IDE).
Ahh so for my purposes, since i am using an arduino UNO, i do not want to use this library? Do you know why it is that it will not run on arduinos, but it will run on something that still uses the arduino IDE (and arduino programming language).
fungus:
OK, read those two statements again...see where you contradict yourself.
All WS2811 libraries have to run at the exact same speed because WS2812 chips need very precise timing.
If the Adafruit library works for you... use it.
I guess what i meant by "faster" was more memory efficient as to reduce lag, but i suppose that also doesn't make sense because if there were any lag in the system then it wouldn't run correct at all either. So can you explain exactly what the advantages of the SPI library entail? I haven't tried the adafruit one because i haven't received my LED strips, i am just excited and wanted to start reading documentation and example code for the library i will soon learn.
Riva:
You have decided on the hardware so just write some test code to display the LED effects you want using all 3 libraries and decide what one best suits your needs and memory usage budget. When doing my first Arduino project I did tests with different libraries for driving the MAX7219 and then selected the one that best suited my need.
I will probably end up doing that, i just wanted to get a better comparison of advantages and disadvantages of each language.
Paul__B:
It is all of that - except that it does not run on the Arduino, but instead the "Teensy" series of modules, which use different processors (but do use the Arduino IDE).
Ahh so for my purposes, since i am using an Arduino UNO, I do not want to use this library? Do you know why it is that it will not run on Arduinos, but it will run on something that still uses the Arduino IDE (and Arduino programming language).
Just as I said, the library is for a different microprocessor with different performance and hardware features.
A "C" compiler can use different assemblers as it needs to, for different processor architectures. You can use "C" (variants) to program Intel chips, AVRs, PICs, as long as you have the assembler for them. The Arduino IDE contains modules for various processors.
Silman:
So can you explain exactly what the advantages of the SPI library entail?
The FastSPI_LED library started out by doing SPI much faster than most of the other methods out there that I had seen for doing SPI on the arduino platform. It's since grown to do a lot more (enough so that the next release of the library will probably drop the SPI from the name). While one of the other folks in this thread was correct in that the WS2811 and friends have very precise, exact timing, there's other areas that the library can provide performance improvements. FastSPI_LED2 has a number of high performance math functions specifically for working with 8 bit rgb values, as well as a fast (and more color accurate) HSV to RGB conversion methods (since, personally, I find working in HSV to be much more natural than RGB, then convert to RGB on output).
Also - while it is true that the WS2811 and friends have precise timing, the FastSPI_LED2 library takes advantage of the holes in that timing to provide non-destructive, zero-overhead global brightness scaling (e.g. a global setBrightness function that you can use to scale the overall brightness of our led output, independently from how you are painting each individual led), even on the ATTiny85s, so in that sense, the library is faster than other libraries out there, but we're looking at the whole picture overall of doing led programming.
(Personally, I can't wait to get this release out the door, it'll let me move on to adding 16bit RGB chipsets and processing, as well as more efficient parallel output on multiple platforms, as well as full due support, as well as DMA support, as well as even more MCU platform support, beyond just arduino family and friends, etc... etc... etc..)