一、测试基本功能1、测试代码
#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# TEST1.PY -- by Dr. ZhuoQing 2021-11-29
#
# Note:
#============================================================
from machine import Pin,Timer
import utime
led0 = Pin('PB2', mode=Pin.OUT_PUSHPULL)
print("Test Timer.")
def t0_callback(self):
led0(1-led0())
t0 = Timer(0, mode=Timer.PERIODIC, callback=t0_callback, period=100)
while True:
pass
#------------------------------------------------------------
# END OF FILE : TEST1.PY
#============================================================
2、测试结果
>> Reset MicroPython...
>> Wait for MicroPython coming back...
>> Download MicroPython : 27 lines/657 characters.
>> -------------------------------------------------------------------------
Test Timer.
|