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 Code

2. Install MicroPico Extension

The MicroPico extension (by Paul Ober) is the recommended tool for Pico development.

  1. Open VS Code.
  2. Click on the Extensions icon in the Activity Bar on the side (or press Ctrl+Shift+X).
  3. Search for "MicroPico".
  4. 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

1

Option A: Open Workspace (Recommended)

The workspace file provides the best development experience:

  1. In VS Code, go to File → Open Workspace from File...
  2. Navigate to the Fabrica code directory
  3. Select fabrica.code-workspace
  4. Click Open

💡 Benefits: MicroPico configured, Python linting enabled, recommended extensions suggested

2

Option B: Open Folder

Alternatively, go to File → Open Folder... and select the folder where you extracted the Fabrica source code (containing main.py).

3

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:

Right-click project folder → "MicroPico: Upload project to 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.

Ctrl + Alt + R
Run current file on Pico
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 dialout group or check USB permissions.
  • IntelliSense not working: Run MicroPico: Configure Project again to generate the .vscode/settings.json file with correct paths.