I am currently getting into a couple of FastLED projects, one of which is the infamous disco table on instructables.com. I am using a slightly different set up than the one on the website and am therefore writing my own code for it. I am running into the issue of having to copy and paste tons of code because I cant figure out how to set different defined led strips within the same for statement. I am sure there is a way to do this but I'm just not sure how.
My code is as follows
for(int i=0; i<=2; i++){
leds1*.r = A;*
_ leds1*.g = Z;_
_ leds1.b = Y;
}*
FastLED.show();
delay(100);
The problem is this, I have 6 led strips that are all declared as "leds1", "leds2", "leds3", etc. etc. all the way too 6, each strip has 18 leds' The variables A, Z, Y, are randomly assigned integers with a maximum value of 255, to get random colors. I need 3 leds to turn on the same color per call, on each strip. This is due to the design.
Is it possible to replace the string "leds1" with a variable and then loop through those strings while reusing the AZY variables to keep the code short?_