

代码一定要让别人可以运行的文本,不要贴图片
import time,pyb
from pyb import UART
led = pyb.LED(3)
uart = UART(3, 9600, timeout_char=1000)
uart.init(9600, bits=8, parity=None, stop=1, timeout_char=1000)
while(True):
#led.on()
uart.write('1\r\n')
if uart.any():
print(uart.read(1))
time.sleep(100)我运行这个代码没有问题。
你可以尝试:
- 重新刷固件
- 换成配套的数据线
- 换一个电脑上USB插口
好的,谢谢你~~~~~~~~~