Could someone show me an example of how to flicker a single LED and

Could someone show me an example of how to flicker a single LED and dim it down from full brightness to 0? I’m not sure how to nest the functions in a loop? Thanks in adavance… I know this is basic stuff… but Im a slow learner.

I just did a bunch of .setBrightness changes but it’s far from tidy… I’m no good at this stuff… But I know enough to be a bother

Yucky like this: FastLED.setBrightness(96);
fill_solid(candle3, NUM_LEDS, CRGB::Orange);
FastLED.show();
delay(50);
FastLED.setBrightness(56);
fill_solid(candle3, NUM_LEDS, CRGB::Orange);
FastLED.show();
delay(50);
FastLED.setBrightness(76);
fill_solid(candle3, NUM_LEDS, CRGB::Orange);
FastLED.show();
delay(50);
FastLED.setBrightness(46);
fill_solid(candle3, NUM_LEDS, CRGB::Orange);
FastLED.show();
delay(50);
FastLED.setBrightness(66);
fill_solid(candle3, NUM_LEDS, CRGB::Orange);
FastLED.show();
delay(50);
FastLED.setBrightness(36);
fill_solid(candle3, NUM_LEDS, CRGB::Orange);
FastLED.show();
delay(50);
FastLED.setBrightness(26);
fill_solid(candle3, NUM_LEDS, CRGB::Orange);
FastLED.show();
delay(50);
FastLED.setBrightness(255);
fill_solid(candle3, NUM_LEDS, CRGB::Black);
FastLED.show();
delay(50);
FastLED.setBrightness(BRIGHTNESS);

use the function fadeToBlackBy( leds, NUM_LEDS, 20);
You can increase the 20 and it will extend the fade
NUM_LEDS is how many LED’s you want to fade

Hello @Jon_Bruno . Looking at your example… since the same steps are repeating you could put this in a loop, and at the same time have some numbers picked at random for you, for example the value (brightness) and also the delay.

void loop() {
hue = 32; // color orange
value = random8(50,255); //pick random number from 50-255
fill_solid( candle3, NUM_LEDS, CHSV(hue,255,value) );
FastLED.show();
delay( random8(50,150) ); //pick random number from 50-150
}

Note, instead of using CRGB (for Red, Green, Blue), the above is using CHSV (for Hue, Saturation, Value) which can sometimes be easier to use depending on what you’re trying to do. Have a look at this page:

FastLED.setBrightness() can certainly be used to change the over all brightness and might be used like you did in certain cases, but since it will effect ALL pixels this might be inconvenient or not really possible to use in such a way when doing more complex animations.

Thank you Marc, Yes all of the pixels are affected and that’s not really what I want to do… however in this one instance it actually enhances whats going on.
I’m making a fake birthday cake and I’m using LM393’s and Electret mics to detect when the person is blowing on the “candles” the side effect of the way I did with the global brightness var it makes it look like all of the candles are getting blown about but only the one in question is actually going out because at the end of the function its set to black.
your example is what I was looking for and I will put it in but I still may tinker with the global to get the “all fluttering” effect…
So much to learn, Thank you for your generous help…

Revisiting this question and yes Marc your suggestion to use CHSV is definitely the best way to do it! Thanks again!