from machine import Pin
from micropython import const
import time
# 定义红色 LED 使用的引脚
LED_RED = const(2)
led = Pin(LED_RED, Pin.OUT, value=0) # 创建一个 LED 对象
while True:
led.value(1) # 点亮 LED
time.sleep(0.5) # 等待 0.5 秒
led.value(0) # 熄灭 LED
time.sleep(0.5) # 等待 0.5 秒