Programming Raspberry Pi Pico with Arduino IDE (Pico W Compatible)
Learn how to program the Raspberry Pi Pico and Pico W using the Arduino IDE. The Raspberry Pi Pico is a low-cost microcontroller board built around the RP2040 chip by the Raspberry Pi Foundation. In this guide, you’ll learn how to set up Arduino IDE and begin programming the Raspberry Pi Pico with C/C++.
Step 1: Adding the Raspberry Pi Pico to the Boards Manager
Open Arduino IDE.
Go to File > Preferences.
In the "Additional Boards Manager URLs" field, enter the following URL:
Click OK.
Now, go to Tools > Board > Boards Manager…
Search for "pico" and install the Raspberry Pi Pico/RP2040 boards package.
Once installed, go to Tools > Board, and you'll see a selection of Raspberry Pi Pico boards.
Step 2: Selecting Your Pico Board
Go to Tools > Board and select the Raspberry Pi Pico or Pico W model that you are using.
Step 3: Loading the Blink LED Sketch
Go to File > Examples > 1. Basic > Blink.
The Blink sketch should load, which turns an LED on and off every second.
You can also copy the code below:
Step 4: Connecting the Raspberry Pi Pico in BOOTLOADER Mode
Put the Pico in Bootloader Mode:
If your Raspberry Pi Pico is currently running MicroPython or is new, you need to manually put it into bootloader mode.
Press and hold the BOOTSEL button on the Pico while connecting it to your computer via USB.
A new mass storage device will appear on your computer. You can ignore this window and close it.
Upload the Code:
For future uploads using the Arduino IDE, the Pico board will automatically enter bootloader mode without pressing the BOOTSEL button.
In Arduino IDE, open the Tools > Port menu, then select Select Other Board and Port....
Select the Pico: Choose Raspberry Pi Pico or Raspberry Pi Pico W as the board, and select the appropriate COM port.
Tick Show All Ports if the COM port doesn’t show up, and select UF2 Devices as the port option.
Step 5: Upload the Code
After selecting the correct board and port, click on the Upload button in the Arduino IDE.
Once the code is uploaded, you should receive a success message.
Step 6: Demonstration
If everything went as expected, the onboard LED of the Raspberry Pi Pico should now be blinking every second.