logo

按照视频教程,代码为示例。串口发送数据,电脑收不到任何数据。电脑发送数据,串口可以正常收到。是怎么回事?

2023-05-15 17:53
E
afk1
# UART Control
#
# This example shows how to use the serial port on your OpenMV Cam. Attach pin
# P4 to the serial input of a serial LCD screen to see "Hello World!" printed
# on the serial LCD display.

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)

while(True):
    uart.write("Hello World!\r")
    time.sleep_ms(1000)
a1caebf2-5620-412b-9859-aaf14b464f59.jpg

固件版本:4.4.2

IDE版本: 3.0.3

2023-05-15 17:58
I
网红小智智 星瞳科技

检查一下接线对不对, 引脚焊接的好不好.

另外提供一下正常收到的截图. 和IDE的截图.

2023-05-15 18:04
E
afk1
b7f05a52-c6cd-49a6-a6a2-9578d0868b74.jpg
E
afk1

@kidswong999 接线对的,可以收到数据。引脚焊接也没问题。

2023-05-16 09:52
E
afk1

@kidswong999 我发现电脑串口发送数据后,电脑串口会收到一个返回的十六进制的 00 。但是openmv 按照示例写发送,电脑还是什么都收到不到。

94451278-2b62-4b8f-bce4-dd6fb494e385.jpg
2023-05-16 20:21
I
网红小智智 星瞳科技

我估计是接线或者焊接的问题.

建议寄回检查, 让售后检查OpenMV端是否有问题.