logo

openMV连接mega,arduino串口监视器一般收不到信号,偶尔能收到,openMV一般能收到。

2018-03-28 22:22
O
_18851763197

openMV的测试程序:# 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)

mega程序:

int incomingByte;

void setup() {

Serial.begin(19200);

}

void loop() {

incomingByte=Serial.read();

Serial.println(incomingByte);

}

接线按照教程里接的,没有问题,求解释,感激感激,跟ttl信号电压有关吗?

2018-03-28 22:27
I
网红小智智 星瞳科技

OpenMV 是3.3v的电压,但是接收到5v会认为是1而不会烧毁。

Arduino mega是5v电压,接收到3.3v的电压,一般会认为是1。

建议用示波器看一下具体的信号。

不过还是建议加一个3.3v转5v的转换电路。

2018-03-28 23:09
O
_18851763197

感谢,我用due也试了一下,效果感觉也不好,我明天再去琢磨一下,感谢感谢

O
_18851763197

@kidswong999 感谢,我用due也试了一下,效果感觉也不好,我明天再去琢磨一下,感谢感谢