logo

串口调试扩展板的P4、P5和GND,分别接到RS232的2、3、5口上时显示乱码

2021-03-15 19:00
C
aixn

请问:用串口调试扩展板接“星瞳串口助手SingTownSerialport“时,发送的字符串能够正常显示,但是将串口调试扩展板的P4、P5和GND,分别接到RS232的2、3、5口上时,显示的却是乱码?

C
aixn

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("robotic_gripper open 2")

time.sleep_ms(5000)

uart.write("robotic_gripper close 2")

time.sleep_ms(5000)

C
aixn
0f3e4e33-98b3-42c2-8241-1c09bedab691.png
2021-03-16 18:11
I
网红小智智 星瞳科技

OpenMV是TTL的串口,连在RS232上当然不能用,电压都不一样,没烧坏就算幸运。

2021-03-17 09:45
C
aixn

没讲清楚,电脑没有COM口,用的是USB转232接电脑,用串口调试助手查看的。

2021-03-17 18:49
I
网红小智智 星瞳科技

应该用USB转ttl,而不是USB转232啊

2021-03-18 12:20
C
aixn

好的,我再买一个USB转ttl试试。