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:
- Ubuntu 20.04 laptop
- [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.
- Raspberry Pi Pico board [you can use either Pico or Pico W]
- Micro USB cable to connect laptop with Pico
Here are the simple steps:
- Download the Arduino IDE 2.0 from here and follow the instructions. This basically comes as a Linux 64-bit appimage file.
- 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.
- 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
- Download the post_install.sh file to make sure udev rules are correctly setup for Pico to be recognized properly in Ubuntu/Linux.
- After you have saved the file on your laptop [assuming it is in your home directory] run following commands
chmod 777 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.
Downloading and installing the Arduino IDE 2.0 | Arduino Documentation
A quick guide on how to install the IDE 2.0 on your operative system. In this tutorial, we will show how to download…
Raspberry Pi Documentation - Raspberry Pi Pico and Pico W
Raspberry Pi Pico W adds on-board single-band 2.4GHz wireless interfaces (802.11n) using the Infineon CYW4343 while…