New Feature: Experimental ESP32-WROOM, ESP32-C3, ESP32-S3, ESP32-S3-Pico and Teensy 4.0 support! (Use the Switch Stubs command to get auto-completion for the ESP32 port of MicroPython.)
MicroPico is a Visual Studio Code extension designed to simplify and accelerate the development of MicroPython projects for the Raspberry Pi Pico and Pico W boards. This tool streamlines the coding process, providing code highlighting, auto-completion, code snippets, and project management features, all tailored for the seamless development experience with MicroPython on Raspberry Pi Pico and Pico W microcontrollers.
Website: micropico.paulober.dev
Included auto-completion based on Raspberry Pi Pico W MicroPython firmware: RPI_PICO2_W-20250809-v1.26.0.uf2 from the micropython-stubs project
Works with:
| Platform | x86 | arm64 | armhf |
|---|---|---|---|
| Windows | ✅ | ❌ | |
| macOS | ✅ | ✅ | ❌ |
| Linux | ✅ | ✅ |
⚠️ Included but unsupported
- Auto-completion with docs
- Pseudo terminal integration for communication with MicroPython REPL on a Pico board (with support for tab-completion)
- Running / Transferring files to / from your board
- Run
main.pylike after plugging the board in, with its output in the vREPL (Upload and Restart Board/Restart Board and Show Output) - Built-in virtual-workspace provider for Raspberry Pi Pico boards (does disable Pylance auto-completion)
- Switch between auto-completion and IntelliSense for MicroPython ports
RPi Pico,RPi Pico (W)andESP32(requires pip installed an in PATH) - Device Manager UI for managing wifi connection and installing mip packages (only on
Pico W; experimental) ESP32-WROOM-32,ESP32-C3,ESP32-S3,ESP32-S3-PicoandTeensy 4.0support (experimental)- Works with any MicroPython board: pick its serial port with
MicroPico: Switch Boardif it isn't detected automatically - Available in English, German, Spanish and Italian (follows the VS Code display language)
-
MicroPython firmware flashed onto the Raspberry Pi Pico:
- See Raspberry Pi docs for help.
Visual Studio Code extensions:
ms-python.python| [Install] [Show]visualstudioexptteam.vscodeintellicode| [Install] [Show]ms-python.vscode-pylance| [Install] [Show]
Environment (Linux only):
On most Linux installations the device file of the Pico serial port is owned by root and a group you normal don't have by default (except on Raspberry Pi OS). This leads to timeout and access denied errors when MicroPico tries to connect to the Pico. There are three ways how to solve this problem:
- See Wiki | Linux for a small guide
-
First of all open a folder and run
> MicroPico > Initialize MicroPico Projectcommand viaCtrl+Shift+P(or the equivalent on your platform) VS Code command palette. This will import stubs for autocompletion and the settings into your project folder. For the autocompletion to work, the extension prompts you (after project configuration) to install recommended extensions mentioned in #Requirements. -
Blink the onboard LED in under 5 minutes:
from machine import Pin
from time import sleep
led = Pin("LED", Pin.OUT)
print("Blinking the LED 10 times...")
for i in range(20):
led.value(i % 2 == 0)
sleep(0.5)
led.off()
print("Done.")-
To run the open file, use
> MicroPico > Run Current File on Boardor the "Run" button in the status bar. -
To stop the execution of the currently running program or other operation, run
> MicroPico > Stop Execution. The "Stop" button at the status bar does the same. -
To plot values, run
> MicroPico > Open Plotterand print comma-separated numbers, e.g.print("%.2f, %.2f" % (temp, humidity)). An optional first line likeprint("temp, humidity")names the series.
This extension contributes the following settings:
micropico.autoConnect: Automatically connects to the first detected MicroPython board. A port set inmicropico.manualComDeviceis always used instead.micropico.manualComDevice: Serial port to always connect to, e.g.COM3or/dev/ttyACM0. Works with any board, also ones that aren't detected automatically.MicroPico: Switch Boardlets you pick the port from a list.micropico.syncFolder: This folder will be uploaded to the pyboard when using the upload-project command/button. Leave empty to sync the complete project. (only allows folders within the project). Use a path relative to the project you opened in vscode, without leading or trailing slash.micropico.additionalSyncFolders: Specifies additional folders that can be selected as upload sources when uploading a project. If left empty, the sync will be performed based on the folder specified in the 'syncFolder' setting. Only folders within the project are allowed. Specify the path relative to the project you have opened in Visual Studio Code, without a leading or trailing slash.micropico.syncAllFileTypes: If enabled, all files will be uploaded no matter the file type. The list of file types below will be ignored.micropico.syncFileTypes: All types of files that will be uploaded to the board, separated by comma. All other filetypes will be ignored during an upload (or download) action.micropico.pyIgnore: Comma separated list of files and folders to ignore when uploading relative to syncFolder (no wildcard or regular expressions supported except**/<file|folder>to exclude an item by its name in every sub folder). Use<additionalSyncFolder>:file/to/exclude.pyto create sync folder exclusive exclusion rules (all other rules will always be applied relative to the selected sync folder). ReplaceadditionalSyncFolderwith a value from yourmicropico.additionalSyncFolderssetting or the value frommicropico.syncFolder.micropico.openOnStart: Automatically open the MicroPico terminal (Pico (W) vREPL) and connect to the board after starting VS Code.micropico.statusbarButtons: Select which buttons to show in the statusbar (DO NOT CHANGE, unless you know what you are doing)micropico.gcBeforeUpload: Run garbage collection before uploading files to the board. This frees up memory, which helps when uploading large files, but adds a second or two to the upload.micropico.softResetAfterUpload: Soft-resets your board after any upload action. Useful if you are developing withmain.pyorboot.py.micropico.executeOnConnect: Path to a MicroPython script on the Pico to execute on connect. Leave empty to disable. (must be relative to the root of the Pico's filesystem; doesn't need to begin with a slash; overridesmicropico.openOnStartsetting)micropico.importOnConnect: A MicroPython module to import in vREPL on connect. Leave empty to disable.micropico.noSoftResetOnRun: Disables the soft reset before running a file on the Pico.micropico.alwaysStopRunningProgram: Stop a program still running on the board without asking before uploading, downloading or resetting.micropico.disableRunFileTypeWarning: Don't ask for confirmation when running a file that is not a.pyor.mpyfile.micropico.customVidPidPairs: Additional USB vendor/product ID pairs (in decimal) to detect as MicroPython boards, e.g.[{ "vid": 1027, "pid": 24592 }]for an FTDI FT2232H (0x0403/0x6010).
micropico.isActivated: set when the extension is activatedmicropico.isConnected: set when the extension is connected to a Pico
Bug reports, ideas and pull requests are welcome. See CONTRIBUTING.md to get started, and let us know with the "We use MicroPico" form if you use MicroPico in a course or at work.
MicroPico is licensed under the Apache License 2.0. See NOTICE for third-party attributions. Versions before 4.4.0 were released under the Mozilla Public License 2.0.
Before version 3.0.0, MicroPico was a fork of Pico-Go by Chris Wood, a derivative of Pymakr by Pycom Limited. It has since been rewritten from scratch.
