logo

openmv与STM32F407通信

2018-05-15 08:44
I
_265406

我想让openmv识别色块后把中心坐标实时发送给407板子,用串口一或者串口三通信,不知道这个openmv上的通信协议是跟407板子用的一样吗?有没大佬能贴个例程

I
网红小智智 星瞳科技

串口是标准的协议,比如你两边都用9600 波特率,那就可以通信。

I
_265406

都用串口一,连哪三根线,教程里好像只有串口三的

I
网红小智智 星瞳科技

https://docs.singtown.com/micropython/zh/latest/openmvcam/openmvcam/quickref.html

看引脚图

I
_265406

可以实时发送中心点坐标吗

I
_265406

我说的是OPenmvM7的串口一的引脚是什么?麻烦了

2018-05-15 09:13
I
网红小智智 星瞳科技
15877fe1-82dc-4497-b435-0f0f6ce77057.jpg
I
_265406
# 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, 19200)

while(True):
    uart.write("Hello World!\r")
    time.sleep(1000)

直接将三改成一就行了吗

I
网红小智智 星瞳科技

对:umbrella:

2018-05-15 09:25
I
_265406

这个要是用串口通信助手在电脑上看发送的东西,怎么操作?需要其他模块吗

I
网红小智智 星瞳科技

看教程看教程

http://book.openmv.cc/MCU/serial2.html

2018-05-15 13:52
I
_265406

uart.write("1")

这个发送的是文本还是数字

2018-05-15 14:05
I
网红小智智 星瞳科技

https://forum.singtown.com/topic/327/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98-%E5%A6%82%E4%BD%95%E7%94%A8%E4%B8%B2%E5%8F%A3%E8%BE%93%E5%87%BA%E6%95%B0%E5%AD%97-%E4%BA%8C%E8%BF%9B%E5%88%B6-16%E8%BF%9B%E5%88%B6

2019-12-15 21:07
K
_5tvu

@州山 你好,我现在也在做STM32和openMV的串口通信,请问两者之间是怎么连接的呢。我是这么连接的

RXD(10)—— TXD(P4)

TXD(9)------ RXD(P5)

GND --------- GND

3.3V -------- VIN

但是我一插上就只是闪了一下白光,就灭灯了,没有运行程序

2020-05-07 23:19
8
石过清风

@5tvu 兄弟,这个问题解决了吗?

2020-05-08 10:41
E
x3cb

@5tvu 通信只需要两根线,一根RX,一根TX就行了。