ArduinoThread icon indicating copy to clipboard operation
ArduinoThread copied to clipboard

[Question] setInterval on the fly

Open zytra opened this issue 5 years ago • 2 comments

Hey there, I am using this library with great success, thank you! I am wondering if there is any way to programmatically change the interval time at which a thread runs at without having to remove the thread, set interval, and then re-add it to the thread controller?

zytra avatar Mar 14 '19 08:03 zytra

Hello @zytra you just need to use [nameOfYourThreadObject].setInterval(time) whenever you want in your code, this will change the thread interval without the need to remove and re-add.

joaopedrovbs avatar Mar 21 '19 13:03 joaopedrovbs

Thank you @joaopedrovbs I am going to see if it removes the glitches I am seeing now. Up until now I was clearing the thread controller, adjusting interval and re-adding the threads to the thread controller. thank you

zytra avatar Mar 21 '19 17:03 zytra