FastLED newbie here.  Just wondering if there's a simple way to turn all the

FastLED newbie here.

Just wondering if there’s a simple way to turn all the LEDs in a strip on at the same time. The same color for all would be fine for now.

I’ve messed around (successfully) a little with arrays to turn on sets of LEDs but, judging from the colorpalette code I’ve loaded and run, there must be a more efficient way.

I’ll keep re-reading and the colorpalette code sketch and try some experimental edits, but thought I’d ask in case anyone had time to point me in the right direction.

Thanks!

Try this out:
fill_solid(leds, NUM_LEDS, CRGB::Red); // Set all to red.

Could also use hsv:
fill_solid( leds, NUM_LEDS, CHSV(96, 255, 255)); // Set all to hue green.

I’m a big fan of setting colours by CHSV as you can easily set a LOT of colours with a single 8 bit variable.

Thanks guys! Both ways worked fine… once I remembered to include the FastLED.show(); line – only took me 20 minutes to figure that out. Doh!

Is there also an easy way to light up, say, all the even number leds at once… or every third led… in a string of (for example) 120?

I did some poking around in other people’s sketches and found the following…

/fill_gradient(leds,0,CHSV(96,255,255),479,CHSV(255,100,100),SHORTEST_HUES);

…which allows me to specify specific blocks of leds to apply a gradient to. I’m going to mess around with things and see if I can somehow use the same principal for fill_solid.

That’s one of the upsides to coding – you might mess something up, but you never really BREAK anything!

EDIT: Just found the following… now I just need to figure out how it works and how to make it work for me.

void fill_solid( struct CRGB * pFirstLED, int numToFill, const struct CRGB& color);