Hello everyone!
I've been working for a week or so with a TLC 5940, and until now I achieved what I wanted, even if struggling quite a lot.
Now what I need is to make some LEDs fading in and out according to only one INPUT, but at different speeds.
I found out that there is no problem to fadining in and out at the same speed, but I can't make them fade at different speed.
Basically one pushbutton should be able to control up to 5 different LEDs fading. I tried with just a couple but they flickr...
Here is the code, if someone can give me a suggestion it would be great. I am not posting the entire code because it's quite long, but I think there is something wrong with this that I cannot figure out...
if(buttonState> threshold){
if (!tlc_isFading(LEDchannel) && !tlc_isFading(LEDchannel+1)) {
uint32_t startMillis = millis() + 50;
uint32_t endMillis = startMillis + duration;
tlc_addFade(LEDchannel, 0, maxValue, startMillis, endMillis);
tlc_addFade(LEDchannel, maxValue, 0, endMillis, endMillis + duration);
tlc_addFade(LEDchannel+1, 0, maxValue, startMillis, endMillis);
tlc_addFade(LEDchannel+1, maxValue, 0, endMillis, endMillis + duration/2);
}
tlc_updateFades();