That seems inefficient and still prone to drift. Why not use a couple of timers?
Code:
import machinetimer20 = machine.Timer()timer60 = machine.Timer()def do20(t): print('do 20 second thing')def do60(t): print('do 60 second thing') timer20.init(mode=machine.Timer.PERIODIC, period=20000, callback=do20)timer60.init(mode=machine.Timer.PERIODIC, period=60000, callback=do60)
Statistics: Posted by thagrol — Sat Aug 03, 2024 3:20 pm