#include <FastLED.h>
#define NUM_STRIPS 3
CRGBSet *strips[] = {
new CRGBArray<32>,
new CRGBArray<48>,
new CRGBArray<64>
};
void setup() {
FastLED.addLeds<WS2812B, 3, GRB>(strips[0]->leds, strips[0]->size());
FastLED.addLeds<WS2812B, 4, GRB>(strips[1]->leds, strips[1]->size());
FastLED.addLeds<WS2812B, 5, GRB>(strips[2]->leds, strips[2]->size());
}
// An array of triplets of CHSV colours
CHSV colours[][3] = {
{CHSV(0, 255, 192), CHSV(0, 0, 0), CHSV(0, 0, 0) }, // state 0
{CHSV(0, 255, 192), CHSV(32, 255, 255), CHSV(0, 0, 0) }, // state 1
{CHSV(0, 0, 0), CHSV(32, 255, 255), CHSV(80, 255, 168) }, // state 2
{CHSV(0, 0, 0), CHSV(32, 255, 127), CHSV(80, 255, 255) }, // state 3
};
// calculate how many entries are in the list of colours
const size_t sz_colours = sizeof(colours) / sizeof(*colours);
void fillRings(byte state) {
for (byte i = 0; i <= NUM_STRIPS; i++) {
fill_solid(strips[i]->leds, strips[i]->size(), colours[state][i]);
}
}
void loop() {
static byte state = 0;
EVERY_N_MILLISECONDS(1000) {
fillRings(state);
FastLED.show();
state = (state + 1) % sz_colours;
}
}