如果不能用定时器中断的话 我不会只能用while实时监测串口接收到的字符吧?
1
13223518595
@13223518595
0
声望
3
楼层
339
资料浏览
0
粉丝
0
关注
13223518595 发布的帖子
-
定时器中断里面不能写串口通讯吗
import time
from pyb import Pin, Timerdef tick(timer): # we will receive the timer object when being called
print("Timer callback")
if(uart.any()): print("6")tim = Timer(4, freq=1) # create a timer object using timer 4 - trigger at 1Hz
tim.callback(tick) # set the callback to our tick functionwhile (True):
time.sleep(1000)