VS Code Workflow
Advanced development guide using Visual Studio Code and MicroPico
Why use VS Code?
While Thonny is excellent for beginners, Visual Studio Code (VS Code) offers powerful features for advanced users:
- IntelliSense and code completion
- Better file management for larger projects
- Integrated Git version control
- Robust extensions ecosystem
Step 1: Install Tools
1. Install VS Code
Download and install the latest version of Visual Studio Code from the official website:
Download VS Code2. Install MicroPico Extension
The MicroPico extension (by Paul Ober) is the recommended tool for Pico development.
- Open VS Code.
- Click on the Extensions icon in the Activity Bar on the side (or press
Ctrl+Shift+X). - Search for "MicroPico".
- Click Install on the extension by Paul Ober.
Step 2: Project Setup
✨ Recommended: Use the Workspace File
Fabrica includes a pre-configured workspace file (fabrica.code-workspace) with recommended settings.
Quick Start: File → Open Workspace from File... → Select fabrica.code-workspace
Option A: Open Workspace (Recommended)
The workspace file provides the best development experience:
- In VS Code, go to File → Open Workspace from File...
- Navigate to the Fabrica code directory
- Select
fabrica.code-workspace - Click Open
💡 Benefits: MicroPico configured, Python linting enabled, recommended extensions suggested
Option B: Open Folder
Alternatively, go to File → Open Folder... and select the folder where you extracted the Fabrica source code (containing main.py).
Configure MicroPico
If using Option B (folder), configure MicroPico manually:
Run the command palette (Ctrl+Shift+P) and type:
MicroPico: Configure Project
Step 3: Connect & Run
Connecting to Pico
Connect your Pico 2W via USB. Look at the status bar at the bottom of VS Code.
- You should see "Pico Connected" or similar status.
- If not, click the "MicroPico" text in the status bar to connect manually.
Uploading Files
To sync your local files to the Pico:
Or use the command palette: MicroPico: Upload current file to Pico
Running Code (REPL)
You can run the current file immediately on the Pico without permanently saving it to the device's flash storage.
Interactive Console (REPL)
To see print output and type Python commands directly, click the "Terminal" tab and select "MicroPico Console" (or run command MicroPico: Open Serial Console).
Troubleshooting
- •Connection Error: Ensure no other program (like Thonny or Cura) is using the USB port. Close other tools and retry.
- •Permission Denied: On Linux/Mac, you might need to add your user to the
dialoutgroup or check USB permissions. - •IntelliSense not working: Run
MicroPico: Configure Projectagain to generate the.vscode/settings.jsonfile with correct paths.