logo

串口通信到电脑上,没有反应

2023-04-25 14:59
2
sdwo

1、硬件:USB转TTL,P4接RXD,P5接TXD,VCC接VIN,GND接GND

2、软件:串口助手

3、代码:IDE的自带uart代码

d1f416a4-924e-4a56-8609-0515cf13d32a.png
# 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)
2023-05-04 19:27
I
网红小智智 星瞳科技

tx rx接反了吧