#include <FastLED.h>
#define NUM_STRIPS 5
#define NUM_LEDS_PER_STRIP 16
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
int iMode, iCount;
int iChangeMode=10;
// For mirroring strips, all the "special" stuff happens just in setup. We
// just addLeds multiple times, once for each strip
void setup() {
randomSeed(analogRead(0));
Serial.begin(115200);
// tell FastLED there's 16 NEOPIXEL leds on pin 6
FastLED.addLeds<NEOPIXEL, 6>(leds[0], NUM_LEDS_PER_STRIP);
// tell FastLED there's 16 NEOPIXEL leds on pin 5
FastLED.addLeds<NEOPIXEL, 5>(leds[1], NUM_LEDS_PER_STRIP);
// tell FastLED there's 16 NEOPIXEL leds on pin 4
FastLED.addLeds<NEOPIXEL, 4>(leds[2], NUM_LEDS_PER_STRIP);
// tell FastLED there's 16 NEOPIXEL leds on pin 3
FastLED.addLeds<NEOPIXEL, 3>(leds[3], NUM_LEDS_PER_STRIP);
// tell FastLED there's 16 NEOPIXEL leds on pin 2
FastLED.addLeds<NEOPIXEL, 2>(leds[4], NUM_LEDS_PER_STRIP);
}
void loop() {
iCount=iCount+1;
// Management of counter for change modes
if (iCount>2*iChangeMode){
iCount=0;
}
// Management of light modes
if (iCount>=0 and iCount<=iChangeMode){
iMode=1;
}
if (iCount>iChangeMode){
iMode=2;
}
Serial.print("Contador: ");
Serial.println(iCount);
Serial.print("Modo: ");
Serial.println(iMode);
//for(int x = 0; x < NUM_STRIPS; x++) {
if (iMode==1){
// 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; i++) {
leds[0][i] = CRGB(random(256),random(256),random(256));
leds[1][i] = CRGB(random(256),random(256),random(256));
leds[2][i] = CRGB(random(256),random(256),random(256));
leds[3][i] = CRGB(random(256),random(256),random(256));
leds[4][i] = CRGB(random(256),random(256),random(256));
}
FastLED.show();
delay(500);
FastLED.clear();
FastLED.show();
delay(500);
}
if (iMode==2){
// 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; i++) {
leds[0][i] = CRGB(random(256),random(256),random(256));
leds[1][i] = CRGB(random(256),random(256),random(256));
leds[2][i] = CRGB(random(256),random(256),random(256));
leds[3][i] = CRGB(random(256),random(256),random(256));
leds[4][i] = CRGB(random(256),random(256),random(256));
delay(200);
FastLED.show();
}
delay(300);
FastLED.clear();
FastLED.show();
}
}