[SOLVED] Modify Timer at run time

Dear Blynk team,
in one of my programs I have a timer whose value (time period) I need to change during the execution of the program by a slider widget (Fast / Slow).
But the timer.setInterval function is located within the setup() and so it’s executed only once. I tried to put it within the loop() but this doesn’t work. How can I achieve this target?
Thank you and regards,
Giancarlo

The main loop() is not advisable for anything other than Blynk.run() and timer.run().

SimpleTimer is very versatile and you should look to make changes during a function call.

Details at http://playground.arduino.cc/Code/SimpleTimer

Thank you Costas, I’ll study !

Regards,
Giancarlo

Check the stroboscope example in Blynk library sketches. Might be helpful.

1 Like

Thank you Pavel, the stroboscope example is just what I was looking for !!

1 Like