Source: https://mokxi.com/learn/xiao-rp2040-pinout
Updated: 2026-10-26

Learn

# Seeed XIAO RP2040 pinout: D0 to D10, GPIO numbers and the LEDs

Beginner

Written by the Mokxi team, updated October 26, 2026

Start building free Open the editor

Or see every lesson.

- 455 parts on the bench
- 43 boards running now
- 1.00x real time, on every board

Click to open it in the editor

GPIO 11 turns on the NeoPixel’s power and GPIO 12 fades it around the color wheel, with Adafruit_NeoPixel.

The Seeed Studio XIAO RP2040 is the Raspberry Pi Pico’s RP2040 on a board 21 by 17.5 mm, with seven pads down each side and a USB-C socket. Its silkscreen says D0 to D10, and those are the XIAO family’s numbers, not the chip’s: D0 is GPIO 26 and D6 is GPIO 0. This page gives the GPIO behind every pad, what each one can do, the analog pins, the PWM slices, and the five GPIOs inside the board that drive its lights.

The circuit above is the board in Mokxi turning on its own NeoPixel with GPIO 11 and fading it around the color wheel on GPIO 12. The board also has a red, green and blue user LED, each lit when its pin is LOW, which is the second thing to know about it. The table is held to the same board model the simulator runs, and where Mokxi does less than the chip, the page says so.

## Every pad, with its GPIO number

With the USB socket at the top, the left side reads D0 to D6 and the right side reads 5V, GND, 3V3, then D10, D9, D8 and D7. The Arduino core for the RP2040 defines D0 to D10 and A0 to A3 for this board as GPIO numbers, so digitalWrite(D0, HIGH) drives the pad marked D0, which is GPIO 26. A bare number is a GPIO: digitalWrite(0, HIGH) drives GPIO 0, which is the pad marked D6. No pad has the same number both ways.

The PWM column names the slice and channel: "PWM 5A" is slice 5, channel A. The I2C, SPI and UART pads are where the silkscreen and the core put them: SDA on D4, SCL on D5, SCK, MISO and MOSI on D8, D9 and D10, and TX and RX on D6 and D7.

Seeed XIAO RP2040: the left side top to bottom, then the right, USB at the top
Pin | GPIO | What it can do | Watch out for

D0 | 26 | ADC0 (A0). PWM 5A. | -

D1 | 27 | ADC1 (A1). PWM 5B. | -

D2 | 28 | ADC2 (A2). PWM 6A. | -

D3 | 29 | ADC3 (A3). PWM 6B. | -

D4 | 6 | PWM 3A. I2C SDA (default). | -

D5 | 7 | PWM 3B. I2C SCL (default). | -

D6 | 0 | PWM 0A. UART0 TX on the chip. | In Mokxi a plain pin; Serial goes to the monitor.

5V | - | USB 5 V. | Not a GPIO.

GND | - | Ground. | -

3V3 | - | The regulator’s 3.3 V output. | Not a GPIO.

D10 | 3 | PWM 1B. SPI MOSI (default). | -

D9 | 4 | PWM 2A. SPI MISO (default). | -

D8 | 2 | PWM 1A. SPI SCK (default). | -

D7 | 1 | PWM 0B. UART0 RX on the chip. | In Mokxi a plain pin; Serial goes to the monitor.

## The user LED and the NeoPixel: five GPIOs inside the board

The user LED beside the USB socket is three LEDs in one, each wired from 3.3 V to its pin, so each lights when its pin is LOW. Red is GPIO 17, which is LED_BUILTIN and PIN_LED_R; green is GPIO 16, PIN_LED_G; blue is GPIO 25, PIN_LED_B. So digitalWrite(LED_BUILTIN, LOW) turns the red one on, and a Blink copied from an Uno runs with its on and off swapped.

The NeoPixel is a WS2812 on GPIO 12, PIN_NEOPIXEL, and its supply comes from GPIO 11, NEOPIXEL_POWER. Drive GPIO 11 HIGH first, as Seeed’s examples do, or the NeoPixel stays dark however much data it is sent, here and on the real board. In Mokxi it is a full WS2812 model, so Adafruit_NeoPixel works with NEO_GRB + NEO_KHZ800. None of the five GPIOs reaches a pad.

Seeed XIAO RP2040: the GPIOs wired to the board’s own lights
Pin | GPIO | What it can do | Watch out for

PIN_LED_R | 17 | The red user LED. `LED_BUILTIN`. | Lit when LOW.

PIN_LED_G | 16 | The green user LED. | Lit when LOW.

PIN_LED_B | 25 | The blue user LED. | Lit when LOW. Not the Pico’s green LED.

NEOPIXEL_POWER | 11 | The NeoPixel’s supply. | Drive it HIGH before you send colors.

PIN_NEOPIXEL | 12 | The NeoPixel’s data line. | -

## Analog inputs and PWM

The analog inputs are D0 to D3, which are A0 to A3 and GPIO 26 to 29, the RP2040’s four ADC inputs. analogRead returns ten bits against 3.3 V unless analogReadResolution asks for more. On a Pico, GPIO 29 measures VSYS inside the board; on the XIAO it is a pad of its own, so all four are yours. Keep the signal between 0 and 3.3 V.

Every pad can do PWM. GPIO n is on slice (n / 2) mod 8, channel A for an even pin and B for an odd one. Two pins on one slice share its frequency, though not their duty cycle, so D0 and D1 share slice 5, D2 and D3 share slice 6, D4 and D5 share slice 3, D6 and D7 share slice 0, and D8 and D10 share slice 1. So a servo and a fast motor PWM should go on pads whose slices differ, D9 and D0 for example.

## Serial, I2C, SPI and the buttons

Serial is the USB port in the Arduino core, and in Mokxi it reaches the serial monitor directly. Serial1 is the same port here, and D6 and D7, which are UART0’s pins on the chip, stay ordinary pins. This board has no Serial2.

Wire.begin() puts I2C on D4 for SDA and D5 for SCL, and SPI is D8, D9 and D10 for SCK, MISO and MOSI. The core gives SPI no chip select pad on this board, so pick any free pad for CS. In Mokxi both buses run in software on those pads, because the RP2040’s I2C and SPI blocks are not modeled. BOOT and RESET are buttons, not pads, and the pads on the back (the SWD pair, RUN and the battery pads) are not part of the Mokxi model.

## Questions

What GPIO is D0 on the XIAO RP2040?

GPIO 26. D1 to D3 are GPIO 27 to 29, D4 and D5 are 6 and 7, D6 and D7 are 0 and 1, D8 is 2, D9 is 4 and D10 is 3. Write `D0` in your sketch and the core turns it into the right number.

Which XIAO RP2040 pins are analog?

D0 to D3, which are A0 to A3 and GPIO 26 to 29.

What are the XIAO RP2040 I2C pins?

SDA is D4 (GPIO 6) and SCL is D5 (GPIO 7), the pads `Wire.begin()` uses.

Which pin is the LED on the XIAO RP2040?

There are three, all lit LOW: red on GPIO 17, which is `LED_BUILTIN`, green on GPIO 16 and blue on GPIO 25. The NeoPixel is a fourth light, on GPIO 12.

Why does the XIAO RP2040 NeoPixel stay dark?

Its supply comes from GPIO 11. Add `pinMode(NEOPIXEL_POWER, OUTPUT)` and `digitalWrite(NEOPIXEL_POWER, HIGH)` to `setup()` before `pixel.begin()`.

Which XIAO RP2040 pin should I use for a button?

Any D pad, with `INPUT_PULLUP` and the button to ground. The RP2040 has no strapping pins, so no pad stops the board booting.

Related

## Keep going

Raspberry Pi Pico Pinout: GPIO, PWM, ADC and Power XIAO ESP32-C3 Pinout: D Pins to GPIO, ADC, Boot Pins Arduino NeoPixel (WS2812B): Wiring and Code Raspberry Pi Pico PWM: Slices, Channels and 1 kHz I2C Scanner for Arduino and ESP32, and Fixes Run the XIAO RP2040 in the simulator Help: the XIAO RP2040 model The project page, with the full sketch Beginner

Sources

## Where the facts on this page come from

- Seeed Studio: getting started with the XIAO RP2040 (pinout, LEDs, NeoPixel)
- arduino-pico: the seeed_xiao_rp2040 variant header (D pins, LED pins, NEOPIXEL_POWER, bus pins)
- Raspberry Pi: the RP2040 datasheet (PWM slices, ADC inputs)

## Build this for real

Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.

Start building free Open the editor
