Using Arduino IDE 2.0 & Code on Raspberry Pi Pico Boards

RoboFoundry
3 min readOct 11, 2022

--

I was experimenting to see if Arduino code can be used in Raspberry Pi Pico board. Wouldn’t it be really cool, because now you have access to years and years of Arduino code folks have been writing and sharing with everyone. I set out to do just that and with a little bit of research and some tinkering I got the basic Blink program working in probably 30 mins or so. You can probably do it in 15 mins as I have done the groundwork for you.

My hardware setup looks like this:

  1. Ubuntu 20.04 laptop
  2. [Optional] Cytron Maker-Pico Base board [without the Pico] — this just provides the socket to plug your RPi Pico and its completely optional, all the steps will work without it. The cool thing about this board is, it provides so many connection options without any soldering and you can swap out your Pico boards very easily if you are working on different code on different boards. Love to work with the Cytron boards. Again, I’m not an affiliate, just someone who loves the products.
  3. Raspberry Pi Pico board [you can use either Pico or Pico W]
  4. Micro USB cable to connect laptop with Pico

Here are the simple steps:

  1. Download the Arduino IDE 2.0 from here and follow the instructions. This basically comes as a Linux 64-bit appimage file.
  2. If you have any existing code on your Pico board please go ahead and download/backup so when we reset the board you don’t lose your code.
  3. It is better to start with a reset so download the flash_nuke.uf2 from here and then follow the instructions to reset the flash on Pico
  4. Download the post_install.sh file to make sure udev rules are correctly setup for Pico to be recognized properly in Ubuntu/Linux.
  5. After you have saved the file on your laptop [assuming it is in your home directory] run following commands
cd ~
chmod 777 post_install.sh
sudo ./post_install.sh

At this point the Ubuntu and Pico are setup properly, we can now install the latest Arduino IDE 2.0 which makes it really easy to use arduino code with RPi Pico as it has out of box support now for Pico.

Last step is to add Pico board to Arduino IDE using the board manager. You can watch this quick video to complete the installation.

At this point you are ready to upload the test Blink program to your RPi Pico. Since we already performed the steps to install udev rules, you should not have any issue uploading the code to your Pico board.

First time you connect your Pico to your laptop after you have performed all the setup steps, hold down the Bootsel button and then let go. While uploading the program to Pico using Arduino IDE upload button, you don’t have to hold down the Bootsel button from that point onward.

That’s it, it is really simple to use Arduino code with new IDE 2.0 and its support for Pico.

References:

--

--