#include <FastLED.h>
const unsigned long speed = 100;
const byte brightness = 80;
const byte DATAPIN1 = 5;
const byte CLOCKPIN1 = 11;
const byte DATAPIN2 = 12;
const byte CLOCKPIN2 = 2;
const byte NUM_STRIPS = 2;
const size_t NUM_LEDS_PER_STRIP = 6*12; // needs to be a multiple of 6
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
int ledsarray[NUM_STRIPS][NUM_LEDS_PER_STRIP / 6] ;
void setup() {
for (size_t strip = 0; strip < NUM_STRIPS; strip++)
for (int groupStart = 0, n = 0; groupStart < NUM_LEDS_PER_STRIP; groupStart += 6, n++)
ledsarray[strip][n] = groupStart;
FastLED.addLeds<DOTSTAR, DATAPIN1, CLOCKPIN1 >(leds[0], NUM_LEDS_PER_STRIP);
FastLED.addLeds<DOTSTAR, DATAPIN2, CLOCKPIN2 >(leds[1], NUM_LEDS_PER_STRIP);
FastLED.setBrightness(brightness);
FastLED.clear();
FastLED.show();
delay(1000);
}
void loop() {
for (size_t strip = 0; strip < NUM_STRIPS; strip++)
for (size_t group = 0; group < NUM_LEDS_PER_STRIP / 6; group++) {
fill_solid(&(leds[strip][ledsarray[strip][group]]), 6, CRGB::White);
FastLED.show();
delay(speed);
}
delay(1000);
for (size_t strip = 0; strip < NUM_STRIPS; strip++)
for (size_t group = 0; group < NUM_LEDS_PER_STRIP / 6; group++) {
fill_solid(&(leds[strip][ledsarray[strip][group]]), 6, CRGB::Black);
FastLED.show();
delay(speed);
}
delay(1000);
}