MicroPython ESP32 最小 UART 示例

此示例展示如何使用 MicroPython 在 ESP32 上使用 UART。在此示例中,我们使用映射到引脚 GPIO9 (RX)GPIO10 (TX)UART1

esp32_uart_minimal.py
from machine import UART
uart = UART(1, 115200) # 第一个参数:UART 编号:硬件 UART #1

# 写入
uart.write("test")

# 读取
print(uart.read()) # 读取 as much as possible using

不知道如何将文件上传到 MicroPython 以便在启动时自动运行?


Check out similar posts by category: Embedded, MicroPython, Python