To see the saved files, connect the Raspberry Pi Pico and run Thonny. Go to View and select Files:
Now you can see the files saved before:
By right clicking, you get the options to open the file, download or delete it, check its properties or create a new directory. Rename, move, copy does not seem to be available.
Microcontrollers are standalone devices that start executing the code saved on them as soon as they are powered on. However, the blinker.py program saved on Raspberry Pi Pico doesn’t execute when we power it up. The reason is that this isn’t the main code saved on the microcontroller. Raspberry Pi Pico is configured to run the MicroPython Interpreter. We can instruct MicroPython to run the blinker.py through Thonny IDE, but it would not run by itself when Raspberry Pi Pico is powered up.
The MicroPython Interpreter however will run a program by itself, if it’s saved in a file named main.py
Since there’s no option to rename our blinker.py we can open it and then save as main.py
Click on Raspberry Pi Pico
Save as main.py
When OK is clicked, the file is saved and appears in the Files panel
Now if we unplugthe Raspberry Pi Pico and power it up independently, the onboard LED starts to blink by itself without having to run the program through Thonny.
Regaining control through Thonny
When the MicroPython Interpreter is busy running the main.py it isn’t connected to Thonny. Press CTRL+F2 to stop the execution of the python program and connect MircoPython to Thonny.
565 total views, 1 views today