Hi, Im using an Arduino Nano with WS2812B LEDs
How do I make a code for a sunrise (from faint Red to Daylight color) ?
do I have to assign colors one after the other with a delay() function in between ? I can’t seem to find the right function on the FastLED documentation, it’s confusing.
I threw together a quick example here: https://gist.github.com/jasoncoon/d54216fc8ce2eb0ecee87f8002d421c5
I won’t be able to test this out until later today, but this should work, or at least get you started. Let me know if this works for you, and be sure to share a video if you get it working. Good luck!
There’s definitely a way to choose a starting color and then have FastLED transition to a final color. I’m not experienced enough to remember it though. Perhaps fill_gradient?
There are a bunch of functions at the link below that you could write a simple sketch for. Just plug in different functions… see what they do… and see if you can edit one for the effect you want.
http://fastled.io/docs/3.1/group___colorutils.html#gae8c0a05b75034b4a2cae20ddc70ec15f
Or… someone much smarter than me might have a simple answer if you’re patient.
See! I told you someone much smarter cough @Jason_Coon cough could help!
I don’t know about smarter, I’ve just made similar animations before.
I’m sure there are better/simpler ways that someone else can point out.
@Jason_Coon Thanks Jason, the code worked well, however I tweaked the value of static const uint8_t interval = 1; and static const uint8_t sunriseLength = 4; to my preference.
Thanks again.
@Aljubouri_A Cool, glad to hear it! Yeah, I figured you’d want to adjust at least sunriseLength.
If you’re manually specifying interval, you don’t need sunriseLength at all. It was just being used to calculate interval.
Oh, and I’m looking forward to seeing a video of it in action. 
@Jason_Coon There, Check it out !
i try and use your code and i get "
sketch_feb23a:67: error: call of overloaded ‘ColorFromPalette(TProgmemRGBPalette16, uint8_t&)’ is ambiguous
CRGB color = ColorFromPalette(HeatColors_p, heatIndex);"