Skip to main content

wokwi-pi-pico Reference

Raspberry Pi Pico, an RP2040 microcontroller board with dual-core ARM Cortex-M0+ processor, 264k of internal RAM, and flexible Programmable I/O (PIO) feature.

Raspberry Pi Pico

Pin names#

Pins GP0 to GP22 are digital GPIO pins. Pins GP26, GP27, and GP28 are digital GPIO pins with analog input function.

NameDescriptionAnalog input channel
GP0 … GP22Digital GPIO pins (0 to 22)
GP26Digital GPIO pin 260
GP27Digital GPIO pin 271
GP28Digital GPIO pin 282
GND.1 … GND.8Ground pins *
VSYS, VBUS, 3V3Positive power supply
TP4 †Digital GPIO pin 23
TP5 †Digital GPIO pin 25 + LED

* The physical pin numbers of the ground pins are 3, 8, 13, 18, 23, 28, 33, and 38.
† These pins do not appear in the visual diagram editor, but you can use them in your diagram.json file.

Pins 3V3_EN / RUN / ADC_VREF are not available in the simulation and are therefore omitted from the table.

Onboard LED#

The Raspberry Pi Pico has an onboard LED, attached to GPIO PIN 25. The LED is lit when the pin is driven high.

You can also use the LED_BUILTIN constant to reference the LED in your Arduino code:

digitalWrite(LED_BUILTIN, HIGH);

See Blink for a complete code example.

Simulation features#

The Raspberry Pi Pico is simulated using the RP2040js Library.
This table summarizes the status of the simulation features:

Processor core✔️Only a single core is simulated
PIO✔️Not widely tested; PIO Debugger available
Timer✔️Pausing the timer not implemented yet
ARM SysTick Timer🟡Partial implementation
ADC + Temp sensor❌
SSI🟡Just the minimum to make the bootloader happy
GDB Debugging✔️See the GDB Debugging guide

✔️ Simulated
🟡 Partial implementation/work in progress
❌ Not implemented

We're adding the missing features in weekly live streams. Expect the list above to update every week or two.

Arduino core#

The Arduino core provides the built-in Arduino functions, such as pinMode() and digitalRead(), as well as a set of standard Arduino libraries, such as Servo, Wire and SPI.

When compiling your code for the Raspberry Pi Pi Pico, you can choose between two different cores:

You can learn about the key differences between these two cores in this GitHub comment.

To select a core, set the "env" attribute of the wokwi-pi-pico part. For the official Arduino core, use the value "arduino-core". For the community maintained core, set "env" to "arduino-community". e.g.:

"parts": [
"type": "wokwi-pi-pico",
"id": "pico",
"attrs": {
"env": "arduino-community"

Serial Monitor#

You can use the Serial Monitor to receive information from the code running on the Pi Pico, such as debug prints. To configure the serial monitor connection with the Raspberry Pi Pico, add the following connections to your diagram.json file:

"connections": [
[ "$serialMonitor:RX", "pico:GP0", "", [] ],
[ "$serialMonitor:TX", "pico:GP1", "", [] ],

The example assumes that the Pi Pico was defined with an id of "pico", e.g.

"parts": [
"type": "wokwi-pi-pico",
"id": "pico",

To initialize the Serial monitor in your code use Serial1.begin(115200), and then print messages with Serial1.println(). For example:

void setup() {
Serial1.println("Hello, world!");
void loop() { }

Note the usage of Serial1. The standard Serial in the Arduino Core uses Serial over USB (CDC), which is currently not supported in the simulation. Serial1, in contrast, uses the hardware UART (connected to pins GP0/GP1).

For a complete example, check out the Pi Pico Serial Monitor Example.

Exporting UF2 binary#

You can upload the program from the emulator directly into a physical Raspberry Pi Pico board. The steps are:

  1. Press "F1" in the Wokwi code editor and select "Download UF2 Binary". The download should start within a few seconds.
  2. Start your Pi Pico in bootloader mode. You can do this by pressing the boot loader button while plugging the Pi Pico into the USB port of your computer.
  3. You should see a new drive appear on your computer (named "RPI-RP2"). Copy the UF2 file you downloaded into that drive.

MicroPython Support#

The Raspberry Pi Pico supports MicroPython, and you can use it for running MicroPython projects in Wokwi. For more information, check out the MicroPython Guide.

Simulator examples#