📜  stm32 微控制器中的 WKUP2 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:44.122000             🧑  作者: Mango

代码示例1
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