On an arduino I would have to check every task I need to do within the loop() function and check the time tick to see if 60 seconds expired or not. If I do the same in micropython, I am afraid that it will waste a lot of cpu resources and don't know how the background routines will be treated, say if I have an infinite loop like this:
Code: Select all
f=open()
start=rtc.now()
while True:
if now-start<60:
if button_pressed:
close data file
break
collect data and save to file