from machine import Pin
from time import sleep_ms

led = Pin(4, Pin.OUT)
while 1:
    led.on()  # 灯亮
    sleep_ms(500)  # 等待500毫秒
    led.off()  # 灯灭
    sleep_ms(1500)