• Stars
    star
    198
  • Rank 196,466 (Top 4 %)
  • Language
    TypeScript
  • License
    Mozilla Public Li...
  • Created about 2 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MicroPico (aka Pico-W-Go) is a Visual Studio Code extension designed to simplify and speed up the development of MicroPython projects for the Raspberry Pi Pico and Pico W boards.

Pico-W-Go Visual Studio Code Extension

Pico-W-Go provides code auto-completion and allows you to communicate with your Raspberry Pi Pico (W) board using the built-in REPL console. Run a single file on your board, sync your entire project or directly type and execute commands.

Auto-completion based on Raspberry Pi Pico W MicroPython firmware: rp2-pico-w-20230426-v1.20.0.uf2

Works with:

Platform x64 arm64 armhf
Windows โœ… โœ… โŒ
macOS โœ… โœ… โŒ
Linux โœ… โœ… โœ…

Features

  • Auto-completion and docs
  • Pseudo terminal integration for communication with MicroPython REPL on a Pico (w) board (with support for tab-completion)
  • Running / Transferring files to / from your board
  • Built-in virtual-workspace provider for Raspberry Pi Pico (W) boards

Preview

Requirements

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 Raspbian OS). This leads to timeout and access denied errors when Pico-W-Go tries to connect to the Pico. There are three ways how to solve this problem:

Getting started

  • First of all open a folder and run > Pico-W-Go > Configure Project command via Ctrl+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 auto-completion to work, the extension prompts you (after project configuration) to install recommended extensions mentioned in #Requirements.

  • If you have trouble running > Pico-W-Go > Configure Project, try setting following settings in your global VSCode settings.json:

"picowgo.pythonPath": "/path/to/your/python/executable/python3"
  • Have the onboard LED flashing in under 5 minutes:

Note that accessing the onboard LED is slightly different for the Pico W compared with the Pico (Page 15 Chapter 3.4). So, you can use the following script in place of flash.py:

from machine import Pin
from utime import sleep

pin = Pin("LED", Pin.OUT)

print("LED starts flashing...")
while True:
    pin.toggle()
    sleep(1) # sleep 1sec

Extension Settings

This extension contributes the following settings:

  • picowgo.autoConnect: Ignores any 'device address' setting and automatically connects to the top item in the serial-port list (of Picos).
  • picowgo.manualComDevice: If autoConnect is set to false Pico-W-Go will automatically connect to the serial port specified here.
  • picowgo.syncFolder: This folder will be uploaded to the pyboard when using the sync 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.
  • picowgo.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.
  • picowgo.syncAllFileTypes: If enabled, all files will be uploaded no matter the file type. The list of file types below will be ignored.
  • picowgo.syncFileTypes: All types of files that will be uploaded to the board, seperated by comma. All other filetypes will be ignored during an upload (or download) action.
  • picowgo.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.py to create sync folder exclusive exclusion rules (all other rules will always be applied relative to the selected sync folder). Replace additionalSyncFolder with a value from your picowgo.additionalSyncFolders setting or the value from picowgo.syncFolder.
  • picowgo.openOnStart: Automatically open the Pico-W-Go console and connect to the board after starting VS Code.
  • picowgo.statusbarButtons: Select which buttons to show in the statusbar (DO NOT CHANGE, unless you know what you are doing)
  • picowgo.gcBeforeUpload: Run garbage collection before uploading files to the board. This will free up some memory usefull when uploading large files but adds about a second or two to the upload process.
  • picowgo.softResetAfterUpload: Soft-resets your board after any upload action. Usefull if you are developing with main.py or boot.py.
  • picowgo.pythonPath: Path to the Python interpreter. Defaults to null so it will try to auto-detect a suitable python installation. NOTE: Must be deleted from global settings.json when switing between operating systems and settings-sync is enabled!

Note

  • Most doc-strings for MicroPython functions (descriptions/hints) are from docs.micropython.org by ยฉ 2014-2023 Damien P. George, Paul Sokolovsky, and contributors.
  • For licensing purposes: Prior to version v3.0.0 of this extension the codebase was a fork of github.com/cpwood/Pico-Go which is a derivative product of Pymakr by Pycom Limited.