Parallel asynchronous fades,
I would like to know if there is a library to trigger fades in a non blocking way, with variables for time in,out, direction, duration, and led#.thankyou
What sort of API did you have in mind? I mean: hypothetically, how would you want to invoke it?
Not sure if this is what you are asking,
I’m planing to use led control in a quadcopter , the arduino nano will be communicating via mavlink with the flight controller , and the led management routine will do two main tasks, one is to fade flight signaling LEDs at regular intervals, and the other is to manage LEDs according to different status parameters red from the flight controller.
Then what I’m trying to achieve is a main loop that will be reading mavlink messages, triggering the different LEDs , and updating the led status accordingly.
I need an led that fades in in an accelerated manner, and fades out very fast (flashing led)’ , other that fades in and out slowly, others that will be blinking or fading according to other status, and there should be no sync between them .
Yep that’s helpful! Sounds like you’ve thought it a lot of the way through.
What specific (hypothetical) APIs would you actually want to call? I’m asking you to just make it up, your “ideal” function call to handle each LED.
Eg, write the code you wish you could write, and ahow what it’d look like.
Set an led fade , with start time , duration, color, and direction
Be able to verify if a particular led is fading
Delete a Fede
Mark , I think I found a code that could be adapted to my purpose , I will study it first , it is a tlc5940 library
Link is here
https://code.google.com/p/tlc5940arduino/source/browse/trunk/Tlc5940/tlc_fades.h
will appreciate you advice in case you think the I’m on a good track or should take different approach ,
Looks workable, if a bit complicated. On the other hand, it can probably be made to do what you’re hoping!
Please do report back with what you try and how it goes!
Ok, thankyou
Mark, I have a question,
I understood Alex code , and there are only two functions that needs to be replaced for the fastled functions , TLC_update(), and TLC.set()
Other than that this fade is a single channel fade , then in order to make it RGB, led parameters needs to be converted accordingly.
My question is , what do you think is the best approach for fades, to use HSV cords , keep H unchanged, and fade with S, and V , ? ,; or in other words , what is the right parameter to fade in a color setup ??, thanks
Yep – exactly as you said, I’d keep H constant and vary B. Might want to keep S constant (255) also.
Mark, back at home and working on it …
i have modified the fade function and generated an .h file with it , now i have to make it collaborate with the main code , the main code uses Display[Num_Leds] as an intermediate buffer and it is defined in the main code ,
on the fade function i have to write to Display[] in order to update this buffer , i understand i have to define Display[] on a different place in order to be available on the fade library ,
for example how to use a definition like this
ledsFade = (struct CRGB*)FastSPI_LED.getRGBData();
inside the dafe library in order to be able to write directly on the leds memory block?
appreciate any lead,
thankyou
got it working , by including the fade library code inside the main code, now that is working , i need to put it back into de h file .will post when finished , saludos
Hey! Great that you got it! “C” is a pain sometimes and Arduino doesn’t make it any more clear.
I joined this community specifically to ask questions about integrating the tlc5940 into FastLED. After joining and then searching, I found this thread and am delighted to see it’s a recent thread. Please update with your changes as I’m keenly interested in working FastLED with tlc5940 as well. I’m lazy and would love to take advantage of all yours and Mark’s work. 
Chuck, my work is the other way, I worked in the past with tlc5940,
At that time I studied the tlc5940 fade library, now I have adapted the fade functions to work with the fastSpi library .
So in short, I have migrated to the newer and easier to work with LEDs strips.
Rgs
Ah. I read the comments wrong, I guess… Okay. My C is not the best, but I guess I’ll take a crack at it.