logo

为什么串口发送数据到openmv,那个数据被拆分了,和官网的代码基本上一模一样

2021-08-10 16:48
K
ovly
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'

2021-08-12 16:39
I
网红小智智 星瞳科技

uart = UART (3,9600,timeout_char = 1000,timtout=1000)

I
网红小智智 星瞳科技

不要发送`55`,而是`55\r\n`