import time
from pyb import UART
from pyb import DAC
uart = UART (3,9600,timeout_char = 1000)
dac = DAC("P6")
while(True):
if uart.any():
i=uart.readline()
print(i)
dac.write(int(i))例如发送55
openmv接收到的是
b'5'
b'5'
uart = UART (3,9600,timeout_char = 1000,timtout=1000)
不要发送`55`,而是`55\r\n`