#include <FastLED.h>
#define NUM_STRIPS 2
#define NUM_LEDS_PER_STRIP 15
#define NUM_LEDS NUM_LEDS_PER_STRIP * NUM_STRIPS
CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
const unsigned long delayTime = 500;
// For mirroring strips, all the "special" stuff happens just in setup. We
// just addLeds multiple times, once for each strip
void setup() {
Serial.begin(115200);
Serial.println("Setup-Start");
// tell FastLED there's 15 NEOPIXEL leds on pin A0, starting at index 0 in the led array
FastLED.addLeds<NEOPIXEL, A0>(leds, 0, NUM_LEDS_PER_STRIP);
// tell FastLED there's 15 NEOPIXEL leds on pin A1, starting at index 15 in the led array
FastLED.addLeds<NEOPIXEL, A1>(leds, NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
}
void printLEDNr(int IndexNr) {
Serial.print("leds[");
Serial.print(IndexNr);
Serial.print("]= red");
Serial.println();
}
void loop() {
// count up from 0 to 14
for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
leds[i] = CRGB::Red;
printLEDNr(i);
FastLED.show();
leds[i] = CRGB::Black;
delay(delayTime);
}
// count downwards from 29 to 15
for (int i = NUM_LEDS - 1; i >= NUM_LEDS_PER_STRIP ; i--) {
leds[i] = CRGB::Red;
printLEDNr(i);
FastLED.show();
leds[i] = CRGB::Black;
delay(delayTime);
}
}
ERC Warnings
gnd2:GND: Short circuit