from machine import UART, Pin
import time
# 初始化UART,使用默认引脚(TX: GPIO1, RX: GPIO3)
uart = UART(1, baudrate=115200, tx=1, rx=3)
# 初始化LED引脚(如果需要控制LED)
led = Pin(15, Pin.OUT)
# 串口输出hello World!
uart.write("hello World!\r\n")
# 可选:循环发送hello World!
while True:
uart.write("hello World!\r\n")
time.sleep(1) # 每秒发送一次