5. Run Script Offline(Important)¶
This method is not very convenient if your Pico 4WD car needs to go on the ground and move around.
So how do you get scripts to work without the USB cable?
An easy way to do this is to save this script as
main.py to the Raspberry Pi Pico.
Open Thonny IDE and plug the Pico into your computer with a micro USB cable and click on the “MicroPython (Raspberry Pi Pico).COMxx” interpreter in the bottom right corner.
Open the script first.
If you double click on it, a new window will open on the right.
Then click File -> Save As.
Select Raspberry Pi Pico in the pop-up window that appears.
Set the file name to
main.py. If you already have the same file in your Pico, it will prompt to overwrite it.
Now you can unplug the USB cable, turn on the power switch of Pico-4wd, and Pico-4wd will automatically run this