-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to change fade_speed on the fly? #3
Comments
Well, I found out an easy solution. I just created another function inside basefader.h:
and it worked. I just need to call LEDX.setFadeSpeed(value desired) and it changes accordingly. It seems to work so far... But you could check it out if nothing else breaks... On a side note, not related to this, when I use logarithmic mode to fade a led the result is horrible, it blinks weirdly. If I use log OFF then the LED smoothly fades in and out, with no weird blinking... at least on an Attiny85 and 167, which are the ones I'm using.. So I'm sticking to non-log fading so far.. Best Regards, Rodrigo |
Good solution, thats what I was about to recommend 👌 Feel free to submit a PR if you like! |
I'm not an expert in coding, so I don't know if there's anything in the code about the log effect... But, in order to the fading effects to fit in my Attiny167's memory, I had to change the log values declaration to Const PROGMEM, like this. It then compiled normally as I was running out of memory. I'm also using 1MHz on my attiny167, but even in an attiny85 at 16.5Mhz, in it's built-in led at P1 (pin 1) the effect was the same way really flickering strange.
One more thing I have just added is to change the range on the fly:
So, as I'm using a bicolor led, green and red, with the same value of resistors for both colors,, the green is much stronger than the red. So when I want a perfect "Yellow" I decrease the range of the green, keeping the range of the red higher, and then a nice yellow appears on my button cap! Is that a correct approach? Regards, Rodrigo |
Hi! When using fadinglight, I need to change on the fly the time in ms that fade_speed changes, when using patterns. For instance, If I want to use a pattern blink that takes 2 seconds to be fully on and 2 seconds to be fully off, I need to decrease fade_speed to 2ms. But if I'll use 200 ms to be fully on and then 200 ms to be fully OFF, 30ms as fade_speed works better. So how can I, in the same code change the fade_speed?
Could Fade_speed be put as a parameter inside that speed Setting struct, that allows us to change the pattern blink settings on the fly?
Thanks a lot for your library!
Best Regards, Rodrigo
The text was updated successfully, but these errors were encountered: