I deleted my previous post in favor of this one. I managed to contain the smoke inside of my head today (as opposed to billowing out of my ears.) I managed to get this far … short and sweet.
#include “FastSPI_LED2.h”
#define NUM_LEDS 32
// I just picked these for their location on the DIP package
#define DAT_PIN1 A0
#define CLK_PIN1 A1
CRGB leds[NUM_LEDS];
void setup() {
delay(500);
FastLED.addLeds<WS2801, DAT_PIN1, CLK_PIN1, BGR>(leds, NUM_LEDS);
}
class patternsClass{
public:
void singlePixel() {
for (int pixel = 0; pixel < NUM_LEDS; pixel++) {
leds[pixel] = CRGB::Blue;
FastLED.show();
delay(50);
leds[pixel] = CRGB::Black;
}
}
};
void loop() {
patternsClass patternObj;
patternObj.singlePixel();
}
Now on to my questions:
a) I know how I can define a second string with .addLeds() using another set of DATA and CLOCK pins. But, how would I reference that? Normally when I declare multiple strings, I end up with leds1, leds2, etc., etc. How would the singlePixel() function know what string to run on?
b) Right now that function is what I would call a ‘blocking function’ in that it won’t exit till the for loop is done. That’s bad. I need to be able to do other stuff while it’s running. Sort of like the Blink without Delay setup … So it has to be rewritten somehow. Is it just as simple as what I was doing originally, with a millis() check?