import machine
import time
# --- Configuration ---
# กำหนดขา GPIO ที่เชื่อมกับ LED
# ถ้าใช้ Pico รุ่นธรรมดาคือ 25, ถ้า Pico W ให้เปลี่ยนเป็น 'LED'
LED_PIN = 28
# สร้าง Object led กำหนดให้เป็น Output (ส่งไฟออก)
led = machine.Pin(LED_PIN, machine.Pin.OUT)
# --- Main Loop ---
print("System Starting... Blinking LED")
while True:
led.value(1) # เปิดไฟ (High Voltage / 3.3V)
print("LED ON")
time.sleep(0.5) # รอ 0.5 วินาที
led.value(0) # ปิดไฟ (Low Voltage / GND)
print("LED OFF")
time.sleep(0.5) # รอ 0.5 วินาที