import machine
import time
# GPIO LED
led1_pin = 2
led2_pin = 4
# Initiate LED
led1 = machine.Pin(led1_pin, machine.Pin.OUT)
led2 = machine.Pin(led2_pin, machine.Pin.OUT)
# Blink LED
def blink_led(led, duration):
led.on()
time.sleep(duration)
led.off()
# Blink time
blink_duration = 1
# Loop
while True:
blink_led(led1, blink_duration)
time.sleep(0.1) # Chờ 0.1 giây giữa 2 lần nhấp nháy
blink_led(led2, blink_duration)
time.sleep(0.1)