# Using Raspberry Pi Pico and Pico 2 with Arduino

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/140/033/medium800/arduino_compatibles_b.png?1759177220)

The Raspberry Pi Pico and Pico 2 have revolutionized microcontroller design since their introduction. Inexpensive and powerful, they are a natural use for a variety of projects. They can be programmed in different languages to suit the designer.

If you're looking to program your Pico in CircuitPython. check out this guide by Adafruit:

### Getting Started with Raspberry Pi Pico and CircuitPython - Overview

[Getting Started with Raspberry Pi Pico and CircuitPython](https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython)
[Overview](https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/overview)
If you wish to use Arduino, that can be done also. But it is suggested you follow this guide. Why?

Back in 2021, when the first Raspberry Pi Pico boards arrived, Arduino [provided support](https://blog.arduino.cc/2021/04/27/arduino-mbed-core-for-rp2040-boards/) through a version of their software [coupled with mbed](https://community.element14.com/products/raspberry-pi/b/blog/posts/program-rpi-pico-using-mbed-library-with-arduino-ide), a real-time operating system. While most other Arduino boards run the Arduino compiled code "bare metal" (without need of an operating system), the Arduino development environment (IDE) used mbed, adding a layer of complexity to programming.

Earle F. Philhower, III designed software which places Arduino compiled code onto Raspberry Pi Pico boards without mbed. This "core" provides a programming paradigm like previous boards designers may have used.

This guide provides information on using the [Philhower core](https://github.com/earlephilhower/arduino-pico) to make your Arduino programs.

## Parts
### Raspberry Pi Pico RP2040

[Raspberry Pi Pico RP2040](https://www.adafruit.com/product/4864)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico**. This...

In Stock
[Buy Now](https://www.adafruit.com/product/4864)
[Related Guides to the Product](https://learn.adafruit.com/products/4864/guides)
![Angle shot of Raspberry Pi Pico RP2040](https://cdn-shop.adafruit.com/640x480/4864-00.jpg)

### Raspberry Pi Pico W

[Raspberry Pi Pico W](https://www.adafruit.com/product/5526)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico W**. This...

In Stock
[Buy Now](https://www.adafruit.com/product/5526)
[Related Guides to the Product](https://learn.adafruit.com/products/5526/guides)
![Angled shot of a green microcontroller with castellated pads.](https://cdn-shop.adafruit.com/640x480/5526-01.jpg)

### Raspberry Pi Pico 2 - RP2350

[Raspberry Pi Pico 2 - RP2350](https://www.adafruit.com/product/6006)
 **Raspberry Pi Pico 2** is Raspberry Pi Foundation's update to their popular RP2040-based Pico board,&nbsp;now built on **RP2350** : their new high-performance, secure microcontroller. With a higher core clock speed, double the on-chip SRAM (512KB), double the...

In Stock
[Buy Now](https://www.adafruit.com/product/6006)
[Related Guides to the Product](https://learn.adafruit.com/products/6006/guides)
![Angled shot of thin, green rectangular microcontroller with castellated pads.](https://cdn-shop.adafruit.com/640x480/6006-02.jpg)

### Raspberry Pi Pico 2W

[Raspberry Pi Pico 2W](https://www.adafruit.com/product/6087)
 **Raspberry Pi Pico 2W** is Raspberry Pi Foundation's update to their popular RP2040-based wireless ico board,&nbsp;now built on **RP2350** : their new high-performance, secure microcontroller. With a higher core clock speed, double the on-chip SRAM (512KB), double...

In Stock
[Buy Now](https://www.adafruit.com/product/6087)
[Related Guides to the Product](https://learn.adafruit.com/products/6087/guides)
![Angled Shot of the Raspberry Pi Pico 2W.](https://cdn-shop.adafruit.com/640x480/6087-00.jpg)

Note the Pico and Pico 2 have a USB micro B connector, not USB-C like many other boards. If you need to, be sure to get a good USB data+power cable (not the tiny ones that come with power banks, they're power only).

### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

# Using Raspberry Pi Pico and Pico 2 with Arduino

## Raspberry Pi Pico with RP2040

![](https://cdn-learn.adafruit.com/assets/assets/000/140/253/medium800/arduino_compatibles_a.png?1759869050)

The original Raspberry Pi Pico uses an RP2040 dual Cortex M0+ microcontroller. When introduced, it provided significantly more computing power and RAM than other boards in the price range.

The Raspberry Pi Pico W adds a WiFi and Bluetooth capability.

The Philhower core for Arduino originally focused on RP2040-based boards. When the RP2350 arrived with the Raspberry Pi Pico 2 (and 2 W), the Arduino board support package was augmented with support for that chip also.

The following pages describe how to set things up for a Raspberry Pi Pico with RP2040. The process also applies, with appropriate changes, for other boards based on the RP2040 microcontroller.

&nbsp;

# Using Raspberry Pi Pico and Pico 2 with Arduino

## RP2040 Arduino IDE Setup

The [**Arduino**  **Philhower core**](https://github.com/earlephilhower/arduino-pico) provides support for RP2040 microcontroller boards. This page covers getting your Arduino IDE set up to include your board.

## Arduino IDE Download

The first thing you will need to do is to download the latest release of the Arduino IDE. The Philhower core requires **version 1.8** &nbsp;or higher.

[Arduino IDE Download](https://www.arduino.cc/en/software)
Download and install it to your computer.

Once installed, open the Arduino IDE.

## Adding the Philhower Board Manager URL

In the Arduino IDE, navigate to the **Preferences** window. You can access it through **File \> Preferences** on Windows&nbsp;or&nbsp;Linux, or **Arduino \> Preferences** on OS X.

The **Preferences** window will open.

In the **Additional Boards Manager URLs** field, you'll want to add a new URL. The list of URLs is comma separated, and&nbsp;_you will only have to add each&nbsp;URL once._ The URLs point to index files that the Board Manager uses to build the list of available & installed boards.

Copy the following URL.

`https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json`

Add the URL to the the **Additional Boards Manager URLs** field (highlighted in red below).

![](https://cdn-learn.adafruit.com/assets/assets/000/107/121/medium800/rp2040_arduino_ide_setup_Arduino_Template_preferences_window.png?1638917398)

Click **OK** to save and close **Preferences**.

## Add Board Support Package

In the Arduino IDE, click on **Tools \> Board \> Boards Manager**. If you have previously selected a board, the **Board** menu item may have a board name after it.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/260/medium800/arduino_compatibles_Untitled1b.png?1759870723)

In the **Boards Manager** , search for RP2040. Scroll down to the **Raspberry Pi Pico/RP2040/RP2350 by Earle F Philhower, III** entry. Click **Install** to install it. If it was previously installed, look to make sure you have the latest version.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/261/medium800/arduino_compatibles_b.png?1759870757)

Warning: 

Once installation is complete, click **Close** to close the Boards Manager.

## Choose Your Board

In the **Tools \> Boards** menu, you should now see **Raspberry Pi RP2040 Boards** (possibly followed by a version number).

![](https://cdn-learn.adafruit.com/assets/assets/000/140/259/medium800/arduino_compatibles_Untitled1a.png?1759870630)

Navigate to the **Raspberry Pi Pico RP2040/RP2350** menu. You will see the available boards listed.

Navigate to the **Raspberry Pi RP2040/RP2350** menu and choose **Raspberry Pi Pico**.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/258/medium800/arduino_compatibles_Untitled1.png?1759870544)

Warning: If you are programming a Raspberry Pi Pico or Pico W, ensure you select the board you have and not a another board as the W boards have LED pinning different (though it should be transparent to the user if it is coded as shown).

Re. If you have a Pico board, do not select Pico W, Pico 2, or Pico 2 W. If you have a Pico W, select Raspberry Pi Pico W and don't select Pico or the Pico 2 boards.

Danger: 

Now you're ready to begin using Arduino with your RP2040 board!

# Using Raspberry Pi Pico and Pico 2 with Arduino

## RP2040 Arduino Blink

The first and most basic program you can upload to your Arduino is the classic Blink sketch. This takes something on the board and makes it, well, blink! On and off. It's a great way to make sure everything is working and you're uploading your sketch to the right board and right configuration.

When all else fails, you can always come back to Blink!

![](https://cdn-learn.adafruit.com/assets/assets/000/140/269/medium800thumb/arduino_compatibles_pico_blink.jpg?1759873700)

# Pre-Flight Check: Get Arduino IDE & Hardware Set Up

This lesson assumes you have Arduino IDE set up. This is a generalized checklist, some elements may not apply to your hardware. If you haven't yet, check the previous steps in the guide to make sure you:

- **Install the very latest Arduino IDE for Desktop** (not all boards are supported by the Web IDE so we don't recommend it).
- **Install any board support packages (BSP) required for your hardware.** Some boards are built in defaults on the IDE, but lots are not! You may need to install plug-in support which is called the BSP.
- **Get a Data/Sync USB cable for connecting your hardware.** A _significant_ amount of problems folks have stem from not having a USB cable with data pins. Yes, these cursed cables roam the land, making your life hard. If you find a USB cable that doesn't work for data/sync, _throw it away immediately_! There is no need to keep it around, cables are very inexpensive these days.
- **Install any drivers required** - If you have a board with a FTDI or CP210x chip, you may need to get separate drivers. If your board has native USB, it probably doesn't need anything. After installing, reboot to make sure the driver sinks in.
- **Connect the board to your computer.** If your board has a power LED, make sure its lit. Is there a power switch? Make sure its turned On!

![](https://cdn-learn.adafruit.com/assets/assets/000/140/289/medium800/arduino_compatibles_raspberry_pi_Pico-R3-Pinout-narrow.png?1759953649)

The Pico has the GPIO pin names listed on the bottom of the board as&nbsp; **GPx** , where&nbsp; **x** &nbsp;is the pin number. The Arduino pin name is the number following&nbsp; **GP**. So, for example, pin&nbsp; **GP0** &nbsp;would be Arduino pin&nbsp;`0`.

There is an onboard green LED for user use. Unlike many boards, the Pico lacks a power on LED.

# Start up Arduino IDE and Select Board/Port

OK now you are prepared! Open the Arduino IDE on your computer. Now you have to tell the IDE what board you are using, and how you want to connect to it.

In the IDE find the **Tools** menu. You will use this to select the board. If you switch boards, you _must switch the selection!_ So always double-check before you upload code in a new session.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/290/medium800/arduino_compatibles_Untitled1.png?1759953751)

# New Blink Sketch

OK lets make a new blink sketch! From the **File** menu, select **New**

![](https://cdn-learn.adafruit.com/assets/assets/000/107/498/medium800/blink__image.png?1640454932)

Then in the new window, copy and paste this text:

```auto
int led = LED_BUILTIN;

void setup() {
  // Some boards work best if we also make a serial connection
  Serial.begin(115200);

  // set LED to be an output pin
  pinMode(led, OUTPUT);
}

void loop() {
  // Say hi!
  Serial.println("Hello!");
  
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(500);                // wait for a half second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(500);                // wait for a half second
}
```

Info: 

One note you'll see is that we reference the LED with the constant `LED_BUILTIN` rather than a number. That's because, historically, the built in LED was on pin 13 for Arduinos. But in the decades since, boards don't always have a pin 13, or maybe it could not be used for an LED. So the LED could have moved to another pin. It's best to use `LED_BUILTIN` so you don't get the pin number confused!

# Verify (Compile) Sketch

OK now you can click the Verify button to convert the sketch into binary data to be uploaded to the board.

Note that Verifying a sketch is the same as Compiling a sketch - so we will use the words interchangeably

![](https://cdn-learn.adafruit.com/assets/assets/000/107/503/medium800/blink__image.png?1640455847)

During verification/compilation, the computer will do a bunch of work to collect all the libraries and code and the results will appear in the bottom window of the IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/268/medium800/arduino_blink_Untitled22.png?1759872469)

If something went wrong with compilation, you will get red warning/error text in the bottom window letting you know what the error was. It will also highlight the line with an error.

For example, here I had the wrong board selected - and the selected board does not have a built in LED!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/501/medium800/blink__image.png?1640455513)

Here's another common error, in my haste I forgot to add a `;` at the end of a line. The compiler warns me that it's looking for one - note that the error is actually a few lines up!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/502/medium800/blink__image.png?1640455650)

Info: 

On success you will see something like this white text output and the message **Done compiling.** in the message area.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/504/medium800/blink__image.png?1640455995)

# Upload Sketch

Once the code is verified/compiling cleanly you can upload it to your board. Click the **Upload** button.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/499/medium800/blink__image.png?1640455265)

The IDE will try to compile the sketch again for good measure, then it will try to connect to the board and upload a the file.

**This is actually one of the hardest parts for beginners because it's where a lot of things can go wrong.**

However, lets start with what it looks like on success! Here's what your board upload process looks like when it goes right:

![](https://cdn-learn.adafruit.com/assets/assets/000/140/271/medium800/arduino_compatibles_Untitled23.png?1759874150)

Often times you will get a warning like this, which is kind of vague:

`No device found on COM66` (or whatever port is selected)  
`An error occurred while uploading the sketch`

![](https://cdn-learn.adafruit.com/assets/assets/000/107/505/medium800/blink__image.png?1640456582)

This could be a few things.

**First up, check again that you have the correct board selected!** Many electronics boards have very similar names or look, and often times folks grab a board different from what they thought.

If you're positive the right board is selected, we recommend the next step is to put the board into manual bootloading mode.

## Native USB and manual bootloading

Historically, microcontroller boards contained two chips: the main micro chip (say, ATmega328 or ESP8266 or ESP32) and a separate chip for USB interface that would be used for bootloading (a CH430, FT232, CP210x, etc). With these older designs, the microcontroller is put into a bootloading state for uploading code by the separate chip. It allows for easier uploading but is more expensive as two chips are needed, and also the microcontroller can't act like a keyboard or disk drive.

Modern chips often have 'native' USB - that means that there is no separate chip for USB interface. It's all in one! Great for cost savings, simplicity of design, reduced size and more control. However, it means the chip must be self-aware enough to be able to put _itself_ into bootload/upload mode on its own. That's fine 99% of the time but is very likely you will at some point get the board into an odd state that makes it too confused to bootload.

Warning: 

Before continuing we _really, really_ suggest turning on **Verbose Upload** messages, it will help in this process because you will be able to see what the IDE is trying to do. It's a checkbox in the **Preferences** menu.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/507/medium800/blink__image.png?1640457254)

## Enter Manual Bootload Mode

OK now you know it's probably time to try manual bootloading. No problem! Here is how you do that for this board:

![](https://cdn-learn.adafruit.com/assets/assets/000/140/291/medium800/arduino_compatibles_bootsel.png?1759954134)

Unplug your Raspberry Pi Pico from USB. Ensure the other end of your USB cable is connected to your computer running the Arduino IDE. Press the **BOOTSEL** button and continue holding and plug the USB cable back in to the Pico. Let go of the **BOOTSEL** button. **A new drive named RPI-RP2 should appear.** This is your sign that you can now load the blink sketch by pressing the right arrow button.

If you never get the RPI-RP2 drive, ensure your USB cable is plugged into the computer and not a USB hub and that the cable is a known good data+power USB cable.

Once you are in manual bootload mode, go to the Tools menu, and make sure you have selected the bootloader serial port. **It is almost certain that the serial port has changed now that the bootloader is enabled**

![](https://cdn-learn.adafruit.com/assets/assets/000/140/272/medium800/arduino_compatibles_Untitled23a.png?1759874685)

Now you can try uploading again!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/506/medium800/blink__image.png?1640457185)

Info: 

This time, you should have success!

After uploading this way, be sure to **click the reset button** - it sort of makes sure that the board got a good reset and will come back to life nicely.

Warning: 

It's also a good idea to try to re-upload the sketch again now that you've performed a manual bootload to get the chip into a good state. It should perform an auto-reset the second time, so you don't have to manually bootload again.

# Finally, a Blink!

OK it was a journey but now we're here and you can enjoy your blinking LED. Next up, try to change the delay between blinks and re-upload. It's a good way to make sure your upload process is smooth and practiced.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/270/medium800thumb/arduino_compatibles_pico_blink.jpg?1759873718)

# Using Raspberry Pi Pico and Pico 2 with Arduino

## Raspberry Pi Pico 2 with RP2350

![](https://cdn-learn.adafruit.com/assets/assets/000/140/255/medium800/arduino_compatibles_a.jpg?1759869694)

The upgraded Raspberry Pi Pico 2 uses an RP2350 dual Cortex M33 microcontroller. It increases the computing power by a factor of 2 over the previous RP2040 based boards.

The Raspberry Pi Pico 2 W adds a WiFi and Bluetooth capability.

The Philhower core was augmented to provide support for the RP2350 on the Raspberry Pi Pico 2 (and 2 W).

The following pages describe how to set things up for a Raspberry Pi Pico 2 with RP2350. The process also applies, with appropriate changes, for other boards based on the RP2350 microcontroller.

# Using Raspberry Pi Pico and Pico 2 with Arduino

## RP2350 Arduino IDE Setup

The [**Arduino**  **Philhower core**](https://github.com/earlephilhower/arduino-pico) provides support for RP2350 microcontroller boards. This page covers getting your Arduino IDE set up to include your board.

## Arduino IDE Download

The first thing you will need to do is to download the latest release of the Arduino IDE. The Philhower core requires **version 1.8** &nbsp;or higher.

[Arduino IDE Download](https://www.arduino.cc/en/software)
Download and install it to your computer.

Once installed, open the Arduino IDE.

## Adding the Philhower Board Manager URL

In the Arduino IDE, and navigate to the **Preferences** window. You can access it through **File \> Preferences** on Windows&nbsp;or&nbsp;Linux, or **Arduino \> Preferences** on OS X.

The **Preferences** window will open.

In the **Additional Boards Manager URLs** field, you'll want to add a new URL. The list of URLs is comma separated, and&nbsp;_you will only have to add each&nbsp;URL once._ The URLs point to index files that the Board Manager uses to build the list of available & installed boards.

Copy the following URL.

`https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json`

Add the URL to the the **Additional Boards Manager URLs** field (highlighted in red below). If you already have a board support package in that field, type a comma at the end then add the address above. Both will then be loaded by the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/121/medium800/rp2040_arduino_ide_setup_Arduino_Template_preferences_window.png?1638917398)

Click **OK** to save and close **Preferences**.

## Add Board Support Package

In the Arduino IDE, click on **Tools \> Board \> Boards Manager**. If you have previously selected a board, the **Board** menu item may have a board name after it.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/263/medium800/rp2350_arduino_ide_setup_Untitled1b.png?1759870930)

In the **Boards Manager** , search for RP2040. Scroll down to the **Raspberry Pi Pico/RP2040/RP2350 by Earle F Philhower, III** entry. Click **Install** to install it.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/262/medium800/rp2350_arduino_ide_setup_b.png?1759870897)

Warning: 

Once installation is complete, click **Close** to close the Boards Manager.

## Choose Your Board

In the **Tools \> Boards** menu, you should now see **Raspberry Pi RP2040/RP2350 Boards (in sketchbook)**.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/264/medium800/rp2350_arduino_ide_setup_Untitled1a.png?1759870955)

Navigate to the **Raspberry Pi RP2040/RP2350 Boards** menu. You will see the available boards listed.

Choose **Raspberry Pi Pico 2** from the menu.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/265/medium800/arduino_compatibles_Untitled1d.png?1759871228)

Warning: If you are programming a Raspberry Pi Pico 2 or Pico 2W, ensure you select the board you have and not a another board as the W boards have LED pinning different (though it should be transparent to the user if it is coded as shown).

Re. If you have a Pico 2 board, do not select Pico, Pico W, or Pico 2 W. If you have a Pico 2 W, select Raspberry Pi Pico 2W and don't select Pico 2 or the Pico boards.

Danger: If there is no serial Port available in the dropdown, or an invalid one appears - don't worry about it! The RP2350 does not actually use a serial port to upload, so its OK if it does not appear if in manual bootloader mode. You will see a serial port appear after uploading your first sketch.

Now you're ready to begin using Arduino with your RP2350 board!

# Using Raspberry Pi Pico and Pico 2 with Arduino

## RP2350 Arduino Blink

The first and most basic program you can upload to your Arduino is the classic Blink sketch. This takes something on the board and makes it, well, blink! On and off. It's a great way to make sure everything is working and you're uploading your sketch to the right board and right configuration.

When all else fails, you can always come back to Blink!

![](https://cdn-learn.adafruit.com/assets/assets/000/140/285/medium800thumb/arduino_compatibles_pico_2_blink.jpg?1759937688)

# Pre-Flight Check: Get Arduino IDE & Hardware Set Up

This lesson assumes you have Arduino IDE set up. This is a generalized checklist, some elements may not apply to your hardware. If you haven't yet, check the previous steps in the guide to make sure you:

- **Install the very latest Arduino IDE for Desktop** (not all boards are supported by the Web IDE so we don't recommend it).
- **Install any board support packages (BSP) required for your hardware.** Some boards are built in defaults on the IDE, but lots are not! You may need to install plug-in support which is called the BSP.
- **Get a Data/Sync USB cable for connecting your hardware.** A _significant_ amount of problems folks have stem from not having a USB cable with data pins. Yes, these cursed cables roam the land, making your life hard. If you find a USB cable that doesn't work for data/sync, _throw it away immediately_! There is no need to keep it around, cables are very inexpensive these days.
- **Install any drivers required** - If you have a board with a FTDI or CP210x chip, you may need to get separate drivers. If your board has native USB, it probably doesn't need anything. After installing, reboot to make sure the driver sinks in.
- **Connect the board to your computer.** If your board has a power LED, make sure its lit. Is there a power switch? Make sure its turned On!

![](https://cdn-learn.adafruit.com/assets/assets/000/140/292/medium800/arduino_compatibles_pico_2_pinout.png?1759954462)

Diagram from [pico2.pinout.xyz](https://pico2.pinout.xyz/). Part of [gadgetoid.com](https://www.gadgetoid.com/). License [Creative Commons CC BY 3.0](https://creativecommons.org/licenses/by/3.0/), not remixed or altered.

The Pico has the GPIO pin names listed on the bottom of the board as&nbsp; **GPx** , where&nbsp; **x** &nbsp;is the pin number. The Arduino pin name is the number following&nbsp; **GP**. So, for example, pin&nbsp; **GP0** &nbsp;would be Arduino pin&nbsp;`0`.

There is an onboard green LED for user use. Unlike many boards, the Pico lacks a power on LED.

# Start up Arduino IDE and Select Board/Port

OK now you are prepared! Open the Arduino IDE on your computer. Now you have to tell the IDE what board you are using, and how you want to connect to it.

In the IDE find the **Tools** menu. You will use this to select the board. If you switch boards, you _must switch the selection!_ So always double-check before you upload code in a new session.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/293/medium800/arduino_compatibles_Untitled1d.png?1759954548)

# New Blink Sketch

OK lets make a new blink sketch! From the **File** menu, select **New**

![](https://cdn-learn.adafruit.com/assets/assets/000/107/498/medium800/blink__image.png?1640454932)

Then in the new window, copy and paste this text:

```auto
int led = LED_BUILTIN;

void setup() {
  // Some boards work best if we also make a serial connection
  Serial.begin(115200);

  // set LED to be an output pin
  pinMode(led, OUTPUT);
}

void loop() {
  // Say hi!
  Serial.println("Hello!");
  
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(500);                // wait for a half second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(500);                // wait for a half second
}
```

Info: 

One note you'll see is that we reference the LED with the constant `LED_BUILTIN` rather than a number. That's because, historically, the built in LED was on pin 13 for Arduinos. But in the decades since, boards don't always have a pin 13, or maybe it could not be used for an LED. So the LED could have moved to another pin. It's best to use `LED_BUILTIN` so you don't get the pin number confused!

# Verify (Compile) Sketch

OK now you can click the Verify button to convert the sketch into binary data to be uploaded to the board.

Note that Verifying a sketch is the same as Compiling a sketch - so we will use the words interchangeably

![](https://cdn-learn.adafruit.com/assets/assets/000/107/503/medium800/blink__image.png?1640455847)

During verification/compilation, the computer will do a bunch of work to collect all the libraries and code and the results will appear in the bottom window of the IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/268/medium800/arduino_blink_Untitled22.png?1759872469)

If something went wrong with compilation, you will get red warning/error text in the bottom window letting you know what the error was. It will also highlight the line with an error.

For example, here I had the wrong board selected - and the selected board does not have a built in LED!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/501/medium800/blink__image.png?1640455513)

Here's another common error, in my haste I forgot to add a `;` at the end of a line. The compiler warns me that it's looking for one - note that the error is actually a few lines up!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/502/medium800/blink__image.png?1640455650)

Info: 

On success you will see something like this white text output and the message **Done compiling.** in the message area.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/504/medium800/blink__image.png?1640455995)

# Upload Sketch

Once the code is verified/compiling cleanly you can upload it to your board. Click the **Upload** button.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/499/medium800/blink__image.png?1640455265)

The IDE will try to compile the sketch again for good measure, then it will try to connect to the board and upload a the file.

**This is actually one of the hardest parts for beginners because it's where a lot of things can go wrong.**

However, lets start with what it looks like on success! Here's what your board upload process looks like when it goes right:

Often times you will get a warning like this, which is kind of vague:

`No device found on COM66` (or whatever port is selected)  
`An error occurred while uploading the sketch`

![](https://cdn-learn.adafruit.com/assets/assets/000/107/505/medium800/blink__image.png?1640456582)

This could be a few things.

**First up, check again that you have the correct board selected!** Many electronics boards have very similar names or look, and often times folks grab a board different from what they thought.

If you're positive the right board is selected, we recommend the next step is to put the board into manual bootloading mode.

## Native USB and manual bootloading

Historically, microcontroller boards contained two chips: the main micro chip (say, ATmega328 or ESP8266 or ESP32) and a separate chip for USB interface that would be used for bootloading (a CH430, FT232, CP210x, etc). With these older designs, the microcontroller is put into a bootloading state for uploading code by the separate chip. It allows for easier uploading but is more expensive as two chips are needed, and also the microcontroller can't act like a keyboard or disk drive.

Modern chips often have 'native' USB - that means that there is no separate chip for USB interface. It's all in one! Great for cost savings, simplicity of design, reduced size and more control. However, it means the chip must be self-aware enough to be able to put _itself_ into bootload/upload mode on its own. That's fine 99% of the time but is very likely you will at some point get the board into an odd state that makes it too confused to bootload.

Warning: 

Before continuing we _really, really_ suggest turning on **Verbose Upload** messages, it will help in this process because you will be able to see what the IDE is trying to do. It's a checkbox in the **Preferences** menu.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/507/medium800/blink__image.png?1640457254)

## Enter Manual Bootload Mode

OK now you know it's probably time to try manual bootloading. No problem! Here is how you do that for this board:

![](https://cdn-learn.adafruit.com/assets/assets/000/140/294/medium800/arduino_compatibles_bootsel.png?1759954626)

Unplug your Raspberry Pi Pico from USB. Ensure the other end of your USB cable is connected to your computer running the Arduino IDE. Press the **BOOTSEL** button and continue holding and plug the USB cable back in to the Pico. Let go of the **BOOTSEL** button. **A new drive named RPI-RP2 should appear.** This is your sign that you can now load the blink sketch by pressing the right arrow button.

If you never get the RPI-RP2 drive, ensure your USB cable is plugged into the computer and not a USB hub and that the cable is a known good data+power USB cable.

Once you are in manual bootload mode, go to the Tools menu, and make sure you have selected the bootloader serial port. **It is almost certain that the serial port has changed now that the bootloader is enabled**

![](https://cdn-learn.adafruit.com/assets/assets/000/140/295/medium800/arduino_compatibles_Untitled23b.png?1759954756)

Now you can try uploading again!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/506/medium800/blink__image.png?1640457185)

Info: 

This time, you should have success!

After uploading this way, be sure to **click the reset button** - it sort of makes sure that the board got a good reset and will come back to life nicely.

Warning: 

It's also a good idea to try to re-upload the sketch again now that you've performed a manual bootload to get the chip into a good state. It should perform an auto-reset the second time, so you don't have to manually bootload again.

# Finally, a Blink!

OK it was a journey but now we're here and you can enjoy your blinking LED. Next up, try to change the delay between blinks and re-upload. It's a good way to make sure your upload process is smooth and practiced.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/286/medium800thumb/arduino_compatibles_pico_2_blink.jpg?1759937712)


## Featured Products

### Raspberry Pi Pico RP2040

[Raspberry Pi Pico RP2040](https://www.adafruit.com/product/4864)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico**. This...

In Stock
[Buy Now](https://www.adafruit.com/product/4864)
[Related Guides to the Product](https://learn.adafruit.com/products/4864/guides)
### Raspberry Pi Pico W

[Raspberry Pi Pico W](https://www.adafruit.com/product/5526)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico W**. This...

In Stock
[Buy Now](https://www.adafruit.com/product/5526)
[Related Guides to the Product](https://learn.adafruit.com/products/5526/guides)
### Raspberry Pi Pico 2 - RP2350

[Raspberry Pi Pico 2 - RP2350](https://www.adafruit.com/product/6006)
 **Raspberry Pi Pico 2** is Raspberry Pi Foundation's update to their popular RP2040-based Pico board,&nbsp;now built on **RP2350** : their new high-performance, secure microcontroller. With a higher core clock speed, double the on-chip SRAM (512KB), double the...

In Stock
[Buy Now](https://www.adafruit.com/product/6006)
[Related Guides to the Product](https://learn.adafruit.com/products/6006/guides)
### Raspberry Pi Pico 2W

[Raspberry Pi Pico 2W](https://www.adafruit.com/product/6087)
 **Raspberry Pi Pico 2W** is Raspberry Pi Foundation's update to their popular RP2040-based wireless ico board,&nbsp;now built on **RP2350** : their new high-performance, secure microcontroller. With a higher core clock speed, double the on-chip SRAM (512KB), double...

In Stock
[Buy Now](https://www.adafruit.com/product/6087)
[Related Guides to the Product](https://learn.adafruit.com/products/6087/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)

## Related Guides

- [Feather RP2040 DVI Video Synth](https://learn.adafruit.com/feather-rp2040-dvi-video-synth.md)
- [Adafruit Feather M4 Express](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51.md)
- [Adafruit DS2482S-800 8 Channel I2C to 1-Wire Bus Adapter](https://learn.adafruit.com/adafruit-ds2482s-800-8-channel-i2c-to-1-wire-bus-adapter.md)
- [Adafruit MOSFET Driver](https://learn.adafruit.com/adafruit-mosfet-driver.md)
- [AdaBox 019](https://learn.adafruit.com/adabox019.md)
- [Adafruit NeoPot](https://learn.adafruit.com/adafruit-neopot.md)
- [DeviceScript, TypeScript for Microcontrollers](https://learn.adafruit.com/devicescript.md)
- [Using a Keyboard with USB Host](https://learn.adafruit.com/using-a-keyboard-with-usb-host.md)
- [Adafruit RP2040 Prop-Maker Feather](https://learn.adafruit.com/adafruit-rp2040-prop-maker-feather.md)
- [Adafruit 555 PWM Output STEMMA](https://learn.adafruit.com/adafruit-555-pwm-output-stemma.md)
- [16-Step Drum Sequencer](https://learn.adafruit.com/16-step-drum-sequencer.md)
- [Adafruit High Power Infrared LED Emitter](https://learn.adafruit.com/adafruit-high-power-infrared-led-emitter.md)
- [Adafruit Microphone Amplifier Breakout](https://learn.adafruit.com/adafruit-microphone-amplifier-breakout.md)
- [Adafruit CC3000 WiFi](https://learn.adafruit.com/adafruit-cc3000-wifi.md)
- [Adafruit 1.28" 240x240 Round TFT LCD](https://learn.adafruit.com/adafruit-1-28-240x240-round-tft-lcd.md)
