
Time needed: 3 minutes.
Learn in this tutorial how to easily transfer files from your computer to your Raspberry Pi Pico and vice versa.
When you’ll have completed this tutorial, you will be able to upload and download files to your Raspberry Pi Pico in a very easy way.
- Prepare the hardware
– First you need a computer to run Thonny. In this tutorial we’ll use a Raspberry Pi 4 as our computer. And Thonny is a user-friendly Python IDE to interact with the Raspberry Pi Pico board. If you never used Thonny to program the Raspberry Pi Pico, before continuing, you better have a look at our tutorial “How to start programming the Raspberry Pi Pico“.
– Next you need an USB cable with micro-USB plug.
– And finally you need a Raspberry Pi Pico of course. For this tutorial it doesn’t matter if GPIO-pins are soldered or not.
Visit our shop if you miss any components. - Open Thonny Python IDE and change the View options
In the default View from the Thonny IDE the files aren’t visible. We can make them visible by selecting : View > Files
- Change the working directory of your computer
Now, an additional tab with files should appear on the left side of the Thonny IDE. The files of your computer (top) and the ones of your Raspberry Pi Pico (bottom) should be visible.
Change now the current directory of your computer to the one where your files to be uploaded to the Pico are stored. - Upload the file to the Raspberry Pi Pico
As an example, let’s upload the ‘Hello_World.py’ file to the Raspberry Pi Pico now. Simply, right-click on the file and select ‘Upload to /’ in the dropdown menu to upload the file to your Raspberry Pi Pico.
- Check if the file has been uploaded successfully
Just quickly check in the box at the bottom if the file has been uploaded succesfully to your Raspberry Pi Pico.
You can now open and edit the file in the Thonny IDE.
Similarly, you can transfer files from your Raspberry Pi Pico to your computer. With the same tool, you can also delete files an create new directories on your Raspberry Pi Pico.
And have a look at our tutorial “How to start programming the Raspberry Pi Pico” if you want to learn how to let your Pico run the script without being attached to your computer.