from machine import UART, Pin
import time
# 初始化 UART,使用默认引脚 (TX: GPIO1, RX: GPIO3)
uart = UART(1, baudrate=115200, tx=1, rx=3)
# 启动时输出hello world
uart.write("hello world\n")
# 持续输出hello world,每秒一次
while True:
uart.write("hello world\n")
time.sleep(1) # 等待1秒