Disconnect, push a button and reconnect. Drag the compiled file to the Pico’s mass storage area in the file manager. Watch how the code works.
The above is not a very efficient way of developing. I want to make changes and then just push a button or (better) use a keyboard combo to see how the new code works. This is how it works with for example the original Arduino, can we use the same easy fast method with a Pico?
Develop with Thonny
And it sure is possible to use “one-click-runs”. I tried the free IDE Thonny, where this is possible. The first thing to do is to install Thonny. This can be in several different ways, I choosed Pip:
pip3 install thonny
Then we start Thonny, and in the lower right corner, the “Python 3.1.xx” text is clicked. This opens the Interpreter section, where we can choose the “MicroPython(Raspberry Pi Pico)” package. Then we reconnect the board with the button pushed, and selects “Pico – Board CDC” as “Port”. Then click “Install or update firmware” and when it’s done “Ok”.
Now the software is prepared, and we can try some code. A new file is created, and it gets the following content:
import time while True: print("Hello!"); time.sleep(1)
We can then click the Play button in Thonny’s panel. The code gets transfered to the Pico, and in the Shell panel we see the result. Nice, just what I wanted. An easy way to test the code while developing. But this uses MicroPython, can we use C as well? That’ll be the next thing to explore.