What you need
To program a Raspberry Pi Pico, you'll need:
- A Raspberry Pi Pico or Pico W
- A USB Micro-B cable (for connecting Pico to your computer)
- A computer: PC, Mac, Linux laptop, or Raspberry Pi 4/5
- Programming software (depends on your chosen language—see below)
You write your code on the computer, then transfer (upload) it to the Pico via USB. The Pico runs the code independently once programmed—it doesn't need to stay connected to the computer.
Choose your programming language
The Raspberry Pi Pico can be programmed in three main ways:
- MicroPython — A beginner-friendly version of Python designed for microcontrollers. Recommended for most users, especially those new to hardware programming. Fast to get started, easy to learn, and great for experimentation.
- C/C++ SDK — The official Pico SDK for advanced users who need maximum performance or low-level hardware control. Requires more setup and programming experience.
- Arduino IDE — Use the familiar Arduino development environment if you're already comfortable with Arduino. Good middle ground between ease of use and performance.
If you're just starting, MicroPython is the recommended choice. The sections below cover each method.
MicroPython setup
Install Thonny IDE on your computer. Thonny is a Python IDE that includes built-in support for MicroPython on the Pico. Download it from thonny.org. It's available for Windows, macOS, and Linux. On Raspberry Pi OS, Thonny is pre-installed.
Download MicroPython firmware for the Pico. Get the latest
.uf2file from the Raspberry Pi MicroPython page. Choose the standard Pico firmware or Pico W firmware depending on your board.Connect your Pico in bootloader mode:
- Hold down the BOOTSEL button on the Pico (the white button on the board).
- While holding the button, connect the Pico to your computer via USB.
- Release the BOOTSEL button.
- The Pico will appear as a USB mass storage device named RPI-RP2.
Install MicroPython firmware: Drag and drop the
.uf2file you downloaded onto the RPI-RP2 drive. The Pico will automatically reboot and run MicroPython. The drive will disconnect once installation is complete.Open Thonny and go to Tools → Options → Interpreter. Select MicroPython (Raspberry Pi Pico) and choose the correct port. Click OK.
Test your setup: In Thonny's Shell window, type
print("Hello, Pico!")and press Enter. If you see the message echoed back, your Pico is ready to program.
For a detailed getting-started guide, the official Get Started with MicroPython on Raspberry Pi Pico book (free PDF) is an excellent resource. Find it at raspberrypi.com/documentation/microcontrollers.
C/C++ SDK setup
The Pico SDK provides C/C++ libraries and build tools for programming the Pico. This method requires more setup but offers maximum performance and direct hardware access.
Install the Pico SDK and toolchain. The setup process varies by operating system and is detailed in the official Getting started with Raspberry Pi Pico guide (free PDF). Find it at raspberrypi.com/documentation/microcontrollers.
Set up your build environment. You'll need CMake, the ARM GCC compiler, and the Pico SDK. On Windows, install the official Pico setup installer. On macOS and Linux, follow the manual setup steps in the getting-started guide.
Build and upload examples. The SDK includes example projects. Build them with CMake, then upload the resulting
.uf2file to the Pico in bootloader mode (hold BOOTSEL, connect USB, drag the.uf2file).
The C/C++ SDK is powerful but has a steeper learning curve. If you're new to embedded C programming, start with MicroPython and move to C/C++ later when you need the performance.
Arduino IDE setup
If you're already familiar with Arduino, you can program the Pico using Arduino IDE. This method combines Arduino's ease of use with the Pico's hardware capabilities.
Install Arduino IDE 2.0 if you don't have it. Download from arduino.cc/en/software.
Add Pico board support. Open Arduino IDE, go to File → Preferences, and add this URL to Additional Boards Manager URLs:
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.jsonGo to Tools → Board → Boards Manager, search for Raspberry Pi Pico/RP2040 by Earle F. Philhower III, and click Install.
Connect your Pico via USB (no need for BOOTSEL mode). Select Tools → Board → Raspberry Pi Pico/RP2040 → Raspberry Pi Pico (or Pico W if you have that model).
Select the correct port under Tools → Port.
Try uploading the Blink example: File → Examples → 01.Basics → Blink. Click Upload. The LED on your Pico should start blinking.
If it doesn't work
- Computer doesn't recognize Pico: Make sure you're using a data-capable USB cable (not just a power-only cable). Try a different USB port. Hold BOOTSEL while connecting to enter bootloader mode.
- MicroPython firmware won't install: Ensure the
.uf2file matches your board (standard Pico vs. Pico W). If the Pico doesn't appear as RPI-RP2, try reconnecting while holding BOOTSEL. - Thonny can't connect: Check that you've selected the correct interpreter and port in Thonny's options. Disconnect and reconnect the Pico. On Linux, you may need to add your user to the
dialoutgroup for serial port access. - Arduino upload fails: Verify you've installed the RP2040 board package and selected the correct board and port. Some Pico clones may have slightly different USB identifiers—try manually entering bootloader mode if upload fails.
Need help programming your Pico?
Tell us your Pico model (standard or W), your computer's operating system, and which programming method you're trying.
Contact Vilros Support ↗