Because googlecode is being a [REDACTED] and not allowing us to check in tonight, i’m going to instead regale you with a tale of two libraries.
With FastSPI_LED, if you wanted to set all of your leds to blue (a simple task, no?) your code would look like the following (and eat up 13.5kb in your program flash):
#include <FastSPI_LED.h>
#define NUM_LEDS 300
struct CRGB { unsigned char b; unsigned char r; unsigned char g; };
CRGB *leds;
void setup() {
FastSPI_LED.setLeds(NUM_LEDS);
FastSPI_LED.setChipset(CFastSPI_LED::SPI_TM1809);
FastSPI_LED.setPin(4);
FastSPI_LED.init();
FastSPI_LED.start();
leds = (struct CRGB*)FastSPI_LED.getRGBData();
}
void loop() {
for(int i = 0; i < NUM_LEDS; i++) {
leds[i].r = 0;
leds[i].g = 0;
leds[i].b = 128;
}
FastSPI_LED.show();
}
Had to define your own rgb structure, had to do a bunch of manual setup, you couldn’t have more than one controller, it compiled in the code for every other controller under the sun (which was bad, and will only get worse, I have at least 4 new controllers on my list at home), If your strip color order was changed you’d have to manually tweak the order of RGB in your structure. A good thing you could only have one strip, you don’t have to worry about multiple rgb orderings!
Now? Here’s the same code with FastSPI_LED2, Release Candidate 1:
#include <FastSPI_LED2.h>
#define NUM_LEDS 300
CRGB leds[NUM_LEDS];
void setup() {
FastSPI_LED2.addLeds<TM1809, 4, BRG>(leds, NUM_LEDS);
}
void loop() {
FastSPI_LED.showColor(CRGB::Blue);
}
Much simpler initialization, no inclusion of code you aren’t going to use, convenience functions for setting all the leds, color definitions, utility functions for a variety of basic color effects, you could have multiple controllers, easily, etc… etc… etc…
Barring google code falling off the face of the earth, @Mark_Kriegsman and I will be putting up RC1 tomorrow night. RC1 should be mostly final, with the remaining pieces to be fixing any last minute bugs that come up and writing documentation and example code.
This is going to be a large update - FastSPI_LED, with all its limitations was a mere 928 lines of code. FastSPI_LED2, at the moment, is clocking in at over 5000. There’s a lot to document and show off how to use, and I can’t wait to see what people start doing with it!
See also - Vine