Hello to the FastLED community!
I am brand new with learning Arduino and I am teaching myself how to use the program as well as program my own light strip. Sorry if the following question is easy to answer, but I have been having trouble with arrays
So say I want the first 3 leds in my strip to turn on, but I do not want to write
leds[0].setRGB(255,0,0); FastLED.show();
leds[1].setRGB(255,0,0); FastLED.show();
leds[2].setRGB(255,0,0); FastLED.show();
So I tried to write the code like this instead
leds[0,1,2].setRGB(255,0,0); FastLED.show();
but only the third LED turns on
I have tried defining some leds into an array as follows
//writing variables
int start[3] = {0,1,2};
…
//run the setup
…
leds[start].setRGB(255,0,0); FastLED.show();
but I get the following error when verifying the code
“invalid types ‘CRGB [450][int [3]]’ for array subscript”
My question is, how can I make multiple LEDs turn on with one command, either through defining an array or by assigning them in the call to “leds[0,1,2,…]”, without having to write “leds[0]…leds[1]…leds[2]…” multiple times?
Thanks again, sorry if there is an easy answer, but as I said, I am new to Arduino as well as this program
