Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

Start / Board Guides

Raspberry Pi Pico

Blink the original RP2040 Pico's onboard LED with PlatformIO and C++.

← Choose a different board

What you need

  • An original Raspberry Pi Pico with an RP2040 chip, not Pico W or Pico 2 W.
  • A Micro-USB data cable and a computer with internet access.
  • VS Code with PlatformIO IDE. The onboard LED is enough; no soldered headers or external circuit are required.
Raspberry Pi Pico

Pico GPIO uses 3.3 V and is not 5 V tolerant. Leave external circuits disconnected for this example. Use the separate Pico 2 W guide for that board; these firmware files are not interchangeable.

Setup

  1. Install the editor and extension

    Install VS Code. In Extensions, search for PlatformIO IDE by PlatformIO, install it, and let its setup finish. Already completed the Uno setup? Keep that installation; only the downloaded board project changes.

  2. Identify the original Pico

    Check the RP2040 marking and the board name. This project uses PlatformIO's pico target with Arduino-mbed. Keep the supplied environment for this exercise; changing the Arduino core or board target changes the build.

Your first program

The onboard LED flashes every half-second while the USB serial connection sends a heartbeat once per cycle.

Download complete project ZIP · PlatformIO & C++
main.cpp
#include <Arduino.h>

#ifndef ARDUINO_RASPBERRY_PI_PICO
#error "Use the original RP2040 Pico environment."
#endif

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
  Serial.println("Engineering Club: original Pico heartbeat");
}
platformio.ini
platformio.ini
[env:pico]
platform = raspberrypi@1.20.0
board = pico
framework = arduino
monitor_speed = 115200
  1. Open the complete project

    Download and extract the ZIP. In VS Code, choose File → Open Folder… and open the extracted folder containing platformio.ini and src. Check that the configuration says board = pico; the source uses LED_BUILTIN for the original Pico's GP25 LED.

  2. Build the firmware

    Choose Project Tasks → pico → General → Build, or run the command below in a PlatformIO terminal. Wait for SUCCESS. The output you will copy is .pio/build/pico/firmware.uf2 inside this project. Building alone does not change the board.

    pio run -e pico
  3. Copy the UF2 to the board

    Disconnect USB. Hold BOOTSEL while reconnecting the Micro-USB data cable, then release it when the RPI-RP2 drive appears. Copy .pio/build/pico/firmware.uf2 to that drive. The drive should disappear as the Pico reboots into your program. This replaces its previous firmware; do not copy a Pico 2 W UF2.

Verify it works

The onboard LED should blink with half a second on and half a second off. After the board reboots, open PlatformIO Monitor at 115200 baud, or use the command below. Select the new application serial port, not the BOOTSEL storage drive. Expect the heartbeat to repeat about once a second; press Ctrl+C to close the terminal monitor.

pio device monitor -b 115200
Engineering Club: original Pico heartbeat

Troubleshooting

RPI-RP2 does not appear

Disconnect USB and try again with BOOTSEL held before connection. Use a known data cable. The original Pico uses native USB; installing a CH340 driver does not fix this connection.

No firmware.uf2 after Build

Read the first build error and wait for dependency installation to finish. Use the supplied pico environment. Do not copy an old UF2 from another project.

Blink works but serial is blank

Wait for the application USB port to appear after reboot, then reopen Monitor on that port at 115200 baud.

Toolchain packages no longer install

Keep the exact supplied configuration and capture the package error for a club lead. This reviewed workflow uses Arduino-mbed; upstream Mbed's maintenance sunset means long-term toolchain support needs review before starting a new project.