Hi,
Using a modified FastLED Library example "ArrayOfLedArrays" I am trying to write to two totally separate Neopixle strips which are connected to two different I/O pins on the arduino and contain different numbers of LED's 108 and 180 respectively.
I keep hitting compile errors (the latest one shown below) which ever way I try to write the sketch.
Any guidance with where I am going wrong would be much appreciated, I would also like to write to the LEDS in parallel, i.e. not do a for loop for one set and then a separate for loop for the second set ?
// 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 2
#define NUM_LEDS_PER_STRIP1 108
#define NUM_LEDS_PER_STRIP2 180
CRGB leds[0][NUM_LEDS_PER_STRIP1];
CRGB leds[1][NUM_LEDS_PER_STRIP2];
// 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 108 NEOPIXEL leds on pin A0
FastLED.addLeds<NEOPIXEL, A0>(leds[0], 108);
// tell FastLED there's 180 NEOPIXEL leds on pin 6
FastLED.addLeds<NEOPIXEL, 6>(leds[1], 180);
}
void loop() {
// This loop will go over each led in strip1, one at a time
for (int i = 0; i < NUM_LEDS_PER_STRIP1; i++) {
leds[0][i] = CRGB::Red;
FastLED.show();
leds[0][i] = CRGB::Black;
delay(100);
}
// This loop will go over each led in strip2, one at a time
for (int n = 0; n < NUM_LEDS_PER_STRIP2; n++) {
leds[1][n] = CRGB::Red;
FastLED.show();
leds[1][n] = CRGB::Black;
delay(100);
}
}
Gives the following compile error ? ...
CRGB leds[0][NUM_LEDS_PER_STRIP1];
^~~~
exit status 1
conflicting declaration 'CRGB leds [1][180]'