from machine import Pin
import time
# Define the LED pins
led_red = Pin(11, Pin.OUT)
led_yellow = Pin(8, Pin.OUT)
led_green = Pin(5, Pin.OUT)
try:
while True:
led_red.value(1) # LED Rojo ON
time.sleep(1)
led_red.value(0) # LED Rojo OFF
led_yellow.value(1) # LED Amarillo ON
time.sleep(1)
led_yellow.value(0) # LED Amarillo OFF
led_green.value(1) # LED Verde ON
time.sleep(1)
led_green.value(0) # LED Verde OFF
except KeyboardInterrupt:
# In a WOKWI simulation, cleanup is not usually required,
# but this is a good practice for actual hardware.
pass