This is probably an easy question but I can not seem to be able to get it right at the moment.
I am using the DemoReel100-Sketch which I find very elegant and I am adding some new pattern and testing it out to learn the basic.
I want to add a function that gradually increases the brightness from current brightness to a given value during a given amount of time, and also decrease the brightness in the same way.
I would like to do it in the same way as all the other function in the DemoReel code. Any suggestion?
I think you and I are after the same thing! I found some non-FastLED code and hacked/bashed it to get the effect I want. It starts dark, fades up red, holds, fades down, fades up green, holds, fades down, fades up blue, holds, fades down, repeats.
I need to find a better way to do it – it’s VERY klunky right now, but below is the void loop I created for Mark Kriegsman’s Timed Playlist Sketch…
@Andrew_Tuline@allanGEE thanks for the replies, I had already tried the sin functions and got it to work but the code is not nearly as simple or readable as the other functions in the DemoReel code. Mostly since the sin goes up and down and needs if statement to cut at maximum/minimum.
I was mostly wondering if there is a better way to do this that I must have missed, like a sin-function that only goes up or only down? from given value to another.
@Alborz_Sedaghat I still haven’t been able to wrap my head around any sin functions at all. I think – once I have time – I need to run some simple sketches and have it show the values in real time so I can understand what it’s doing.