Hey, I wanted to make my code very dynamic so that I can modify everything by just modifying a define or const value. I'm coding in C++ and this was my desired code if it would work:
// ...
#define NUM_STRIPS 2
const LED_STRIP_PINS[NUM_STRIPS] = {38, 39};
const LEDS_PER_STRIP[NUM_STRIPS] = {300, 300};
void setup() {
// ...
int tmp = 0;
for(int i = 0; i < NUM_STRIPS; i++) {
pinMode(LED_STRIP_PINS[i], OUTPUT);
FastLED.addLeds<NEOPIXEL, LED_STRIP_PINS[i]>(leds + tmp, LEDS_PER_STRIP[i]);
tmp += LEDS_PER_STRIP[i];
}
}
// ...
The problem of course is that LED_STRIP_PINS[i] can't be used in the context of an template, because i is not constant. Is there anything I could do to fix this? Yes, I know I just could make a define for every strip and make a new "FastLED.addLeds<...>(...)" for every strip, but just out of curiosity - is it somehow possible?