import time
import machine
led_pins = [2, 3, 4, 5, 6, 7, 8, 9, 10]
leds = [machine.Pin(pin, machine.Pin.OUT) for pin in led_pins]
button = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_DOWN)
time.sleep(0.1) # Wait for USB to become ready
continent_value = 1
while True:
if button.value() == 1:
continent_value += 1
leds[continent_value % len(led_pins)].on()
leds[(continent_value % len(led_pins)) - 1].off()
time.sleep(0.5)