// ArrayOfLedArrays - see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for more info on
// using multiple controllers. In this example, we're going to set up three NEOPIXEL strips on three
// different pins, each strip getting its own CRGB array to be played with, only this time they're going
// to be all parts of an array of arrays.
#include <FastLED.h>
#define NUM_STRIPS 3
#define NUM_LEDS_PER_STRIP_1 50
CRGB leds_1[NUM_LEDS_PER_STRIP_1];
#define NUM_LEDS_PER_STRIP_2 40
CRGB leds_2[NUM_LEDS_PER_STRIP_2];
#define NUM_LEDS_PER_STRIP_3 30
CRGB leds_3[NUM_LEDS_PER_STRIP_3];
// For mirroring strips, all the "special" stuff happens just in setup. We
// just addLeds multiple times, once for each strip
void setup() {
// tell FastLED there's 30 NEOPIXEL leds on pin 10
FastLED.addLeds<NEOPIXEL, 10>(leds_1, NUM_LEDS_PER_STRIP_1);
// tell FastLED there's 30 NEOPIXEL leds on pin 11
FastLED.addLeds<NEOPIXEL, 11>(leds_2, NUM_LEDS_PER_STRIP_2);
// tell FastLED there's 30 NEOPIXEL leds on pin 12
FastLED.addLeds<NEOPIXEL, 12>(leds_3, NUM_LEDS_PER_STRIP_3);
}
void loop() {
// This outer loop will go over each strip, one at a time
// This inner loop will go over each led in the current strip, one at a time
for(int i = 0; i < NUM_LEDS_PER_STRIP_1; i++) {
leds_1[i] = CRGB::Red;
FastLED.show();
leds_1[i] = CRGB::Black;
delay(100);
}
for(int i = 0; i < NUM_LEDS_PER_STRIP_2; i++) {
leds_2[i] = CRGB::Red;
FastLED.show();
leds_2[i] = CRGB::Black;
delay(100);
}
for(int i = 0; i < NUM_LEDS_PER_STRIP_3; i++) {
leds_3[i] = CRGB::Red;
FastLED.show();
leds_3[i] = CRGB::Black;
delay(100);
}
}