I using for loops in other parts of the code doing [LED + 1] and so on. I didn’t include the whole code because it’s really long and my question only pertained to these few lines. So, a for loop is going to be the easiest way to do it? I thought maybe there was a really simple way like
LeftStrip [LED2,, 18] = CHSV(200, 255, 255);
// I have used something like this before:
if (digitalRead(BUTTON_INPUT) == LOW) {
(int LED = 2; LED <= 18; LED = LED +1)
LeftStrip[LED] = CHSV(200, 255, 255);
FastLED.show();}
PaulRB:
What you have done there is a for loop, except you got it slightly wrong. Try:
if (digitalRead(BUTTON_INPUT) == LOW) {
for (int LED = 2; LED <= 18; LED++) LeftStrip[LED] = CHSV(200, 255, 255);
FastLED.show();
}
I see, I forgot my “for”. Thanks for the help. I was just looking for another way. I’ll wrap my brain around using for looks to control what lights do what when I want to turn on a “set” in a strip. I’m doing the same thing now in my sequential strips. I’m just doing the whole strip and using delays. This is the same thing just starting and ending in the middle of a strip and with no delay. I think I’ve got a grasp on it now. Thanks again!!!