Welcome to the MicroPython Starters Guide! Follow these steps to set up and run your first MicroPython script on a Raspberry Pi Pico using VSCode.
Enlist the repository from GitHub:
git clone https://github.com/brifl/micro-python-starters.git
Open VSCode and install the MicroPico extension:
- Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
- Search for "MicroPico".
- Click "Install" on the MicroPico extension.
Open the cloned repository folder in VSCode:
- Click on
File
in the top menu. - Select
Open Folder...
. - Navigate to and select the
micro-python-starters
folder.
Connect your Raspberry Pi Pico to your PC via USB-C:
- Ensure you use a data-capable USB-C cable (not a charge-only cable).
- Plug the Pico into your PC.
The latest MicroPython firmware should already be installed on your Pico. However, if you need to update it:
- Download the latest MicroPython firmware from MicroPython Downloads.
- Follow the instructions on the download page to flash the new firmware onto your Pico.
To upload a Python script to your Pico:
- In the Explorer tab in VSCode, right-click on one of the Python files (e.g.,
message.py
). - Select "Upload project to Pico" from the context menu.
Open a new terminal window in VSCode of type "Pico (W) vREPL":
- Click on the Terminal menu at the top.
- Select "New Terminal".
- From the dropdown, select "Pico (W) vREPL".
From the Pico REPL terminal prompt, run:
import message
Observe the onboard LED on your Pico. It should blink your message in Morse code.
Congratulations! You've successfully deployed and run a MicroPython script on your Raspberry Pi Pico.