📅  最后修改于: 2022-03-11 14:45:44.122000             🧑  作者: Mango
from machine import Timer
tim0 = Timer(0)
def my_callback_function(timer): # important (timer)
# do something
tim0.init(period = 1000, mode = Timer.ONE_SHOT, callback = my_callback_function)
# other mode : Timer.PERIODIC
tim0.deinit() # stop timer