在stm32传输数据给openmv4 plus 时不使用decode函数能收到准确的ascii码,在使用后接收到的没有数据。
import sensor, image, time
from pyb import UART
clock = time.clock() # Tracks FPS.
uart = UART(3,115200) #定义串口3变量
#设置串口
uart.init(115200, bits=8, parity=None, stop=0) # init with given parameters
#图像循环
while(True):
if uart.any():
a = uart.readline().decode()
print(a)
import sensor, image, time
from pyb import UART
clock = time.clock() # Tracks FPS.
uart = UART(3,115200) #定义串口3变量
#设置串口
uart.init(115200, bits=8, parity=None, stop=0) # init with given parameters
#图像循环
while(True):
if uart.any():
a = uart.readline()
print(a)
不是没有了,是你看不到了。ascii前面5个是【空字符】【标题开始】【正文开始】【正文结束】【传输结束】
https://baike.baidu.com/item/ASCII/309296?fr=aladdin