像这样的,只能进行到l3.off,后面的代码也会print("------",a)但是打印的不是接收到的
import time,pyb
from pyb import UART
l1 = pyb.LED(1)
l3 = pyb.LED(3)
uart = UART(3,9600,timeout_char=1000)
while True:
l3.on()
if uart.any():
l3.off()
l1.on()
a = []
a = uart.readline()
print(":-----",a)
l1.off()
time.sleep(500)