使用串口只能发送数据但不能接收数据?
-
看的是教程视频,用的是里面的代码,还以为是板子没插好,然后用了万用表测了确实是接通了的
import time from pyb import UART # Always pass UART 3 for the UART number for your OpenMV Cam. # The second argument is the UART baud rate. For a more advanced UART control # example see the BLE-Shield driver. uart = UART(3, 9600, timeout_char=1000) while(True): #uart.write("Hello World!\r\n") #time.sleep(1000) if uart.any(): a = uart.readline() print(a)
-