Skip to content
Sanjay Seshan edited this page Jun 8, 2020 · 10 revisions

LEGO SPIKE PRIME Extension for VS Code

This extension for VS Code will allow you to easily program the SPIKE PRIME in a micropython environment.

This tool was created by Sanjay Seshan for http://www.primelessons.org. If there are any errors or you need additional help, please do not hesitate to open and issue on this GitHub repository.

Features

The available commands are: "Upload to SPIKE PRIME", "List SPIKE PRIME files", "Delete SPIKE PRIME file", "Start SPIKE PRIME program", "Stop SPIKE PRIME program", "Move SPIKE PRIME program", "SPIKE PRIME Firmware Info", and "Create new SPIKE PRIME micropython program" (from template). The end result is that you can run micropython programs on your hub just like a standard scratch program

Programming

See the Hub API link in the page navigation panel.

Here are some sample code: https://github.com/sanjayseshan/spikeprime-samples

Installation

See the install instructions for your operating system in the page navigation panel.

Viewing/Downloading programs from the brick

Use the Adafruit tool ampy to navigate the brick's files and download. You can even download scratch programs converted to python from it.

sudo pip3 install adafruit-ampy

You will have to reboot the brick afterwards as it disables the navigation ui in REPL mode.

Connecting to the hub's Micropython prompt

See http://primelessons.org/translations/en/lessons/MicroPythonIntro.pdf