XIAO ESP32S3 + Micropython + User LED


I’m trying to turn on/off the user LED in Micropython. Have not been successful so far. Normally, I just do something like:

    led = machine.Pin(<PIN_NUMBER>, machine.Pin.OUT)

… but I don’t know what the PIN_NUMBER would be for the user led.

Anyone know?


Hello, you can read the pin picture here:Getting Started | Seeed Studio Wiki, the name of pin is here: if you wanna use the pin D2, you can see D2 match the GPIO3, so you can use it by “IO3”, such as machine.Pin(IO3,machine.Pin.OUT) or two lines like:

machine_pin= digitalio.DigitalInOut(board.IO3) 
machine_pin.direction = digitalio.Direction.OUTPUT

Hi, it would help a lot if you could post a minimal working snippet.

where does “board” come from?
where does “digitalio” come from?


For those of you on esp-idf directly, the user LED is IO21 per the schematics