def blink_led(pin, duration):
    pin.on()
    time.sleep_ms(duration)
    pin.off()
    time.sleep_ms(duration)