Whenever I try running a timer that takes as callback a function containg blocking code in it, the whole repl freezes and does not let me enter any word.
What I am really aming for here is something similar to what the threading module does for python, basically starting a background process without freezing the shell. How can I do it?
Code: Select all
from machine import Timer def handler(timer): time.sleep(1) print('hello') x = Timer(0) x.init(period=1000, mode=1, callback= handler)