from machine import Pin
from time import sleep
# Define the LED pins in reverse order (10 to 1)
led_pins = range(10, 0, -1) # Pins 10 to 1
while True:
# Blink LEDs one by one, from pin 10 to pin 1
for pin in led_pins:
led = Pin(pin, Pin.OUT) # Create Pin object for the selected pin
led.value(1) # Turn on the LED
sleep(0.2) # Delay for 0.5 seconds before turning it off
led.value(0) # Turn off the LED
sleep(0.1) # Small delay before the next LED lights up