Have a heart - a somewhat confused user here. I am using the FastLED library to create a realistic fake candle using a NeoPixel stick. Everything is working but I have a question - is there a way to ONLY change the brightness of a particular LED in the string? In other words, leave hue and saturation the same as is but just change the brightness?
i.e. something like this for a HSV value:
leds[i] = CHSV( keep the same, keep the same, new intensity);
I know I can set the color to Black to turn an LED off but I want to smoothly fade it out.
You want the nscale_video function. You give it a CRGB color and a value from 0-255 and it “dims” the color – the lower the value, the dimmer the result. It is a method on CRGB values. For example, this code takes a color and halves the brightness:
CRGB color = …some color…;
color.nscale8_video(128);
Also: the Fire2012 demo that is provided with the library does a pretty good job of emulating fire.
I would just mention that the Hue , Saturation and Value in the CHSV should be unsigned 8 bit integer variables and you should have full control of them.
For a more detailed answer you should post your sketch on pastebin or github and explain what you can do already and what it is you actually struggle with !
@Sam_Guyer Yes! The color.nscale8_video does want I needed. Thank you!
Fyi - I have tried the Fire2012 code and it just doesn’t look like what I am looking for. I am trying to simulate a candle flame and the Neopixel stick I am using only has 8 leds and I think the Fire2012 code will work better with more leds. As soon as I can figure out how to capture decent video I will post it. Using the camera on my phone makes the flame appear as a “blob” and it doesn’t do it justice.