is there a way to call multiple leds in one instruction instead of calling

is there a way to call multiple leds in one instruction instead of calling them individualilly(leds[1] = CRGB::Red)

FastLED.showColor(CRGB::Red); A single statement, at least, if that’s what you mean. Under the hood, I have a hunch it’s doing the same thing as the more manual version though.

Thanks for the help, I hoped there would be a way to call a range of leds as my other alternative involves manually calling about 35 different leds

There’s nothing wrong with manually setting the color 35 LEDs at a time. In fact, it’s very common to update every LED 60+ times per second.

What problem are you looking to solve here?

im trying to set segments of the led strip to green from their default of red when a sensor is tripped

You mean something like this? https://gist.github.com/Squeegy/a9279ba8fc249b54d317

You’ll need to set each LED’s color in this case. But doing so isn’t hard.

not really. here is my current code
http://pastebin.com/DQ5ZVMFS

Hmm, I would define a function that’s something like setColorRange(CRGB color, uint8_t from, uint8_t to) which loops of the range you specify and sets a color to all LEDs in that range.

how would i go about doing that. sorry im reletivley new to this.

I believe that’s what fill_solid does, except that the arguments are (1) what color, (2) the address of the first led to fill, and (3) the number of leds to fill. I think this would work for you:

fill_solid( color, &leds[from], to-from+1);

Or something like this which requires a bit less math.

void setColorRange(CRGB color, uint8_t from, uint8_t to) {
for (uint8_t i = from; i <= to; i++) {
leds[i] = color;
}
}

setColorRange(CRGB::Red, 1, 3);
// leds 1, 2 and 3 are now set to red.

Yep, that’s what fill_solid does internally anyway. The difference is that fill_solid can work on any array, and the setColorRange function has one led array hard coded into it. Nice example of the trade-off of generality versus convenience!

(Myself, I tend to choose convenience until a good reason forces me to generalize; I like setColorRange for this case.)