Sample Timer – Function called by Timer - renesas/micropython GitHub Wiki

image

  • The software timer function calls print (2) every 2 seconds.
from machine import Timer

tim = Timer(-1)
tim.init(period=2000, mode=Timer.PERIODIC, callback=lambda t:print(2))

image