Example: 50-OpenMV-Boards/52-Alif-Boards/50-Board-Control/uart_control.py
# 本作品采用MIT许可证授权。
# Copyright (c) 2013-2026 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# UART控制
#
# 此示例展示了如何在OpenMV Cam上使用串口。 Attach pin
# P4连接到串口LCD屏幕的串口输入,以看到“Hello World!”打印
# 在串口LCD显示屏上。
import time
from machine import UART
# UART 1 has TX on P4 and RX on P5 on the OpenMV AE3.
# 第二个参数是UART波特率。
uart = UART(1, 19200, timeout_char=200)
while True:
uart.write("Hello World!\r")
time.sleep_ms(1000)