MakeCode for Circuit Playground Express

MakeCode is this programming editor that runs in the Google Chrome web browser. It’s has an intuitive interface that’s both block based and text editor.

It works with Adafruit's Circuit Playground Express so you can make interactive projects with the on-board sensors and components. You can drag & drop blocks to make interactive programs using lights and sounds without having to solder or learning a new syntax.

You can alternatively upload code directly to the Circuit Playground Express with WebUSB, see the steps to do so here.

Setup Circuit Playground Express for MakeCode

To get started, we'll need to head over to the Adafruit MakeCode website and follow the steps below.

  1. Plug in your Circuit Playground Express with a USB Cable
  2. Press the RESET button. Green light means you're ready to MakeCode
  3. Download the UF2 file and drop it onto CPLAYBOOT.

Upload and Test Code

 

Once you have your CPX setup with the MakeCode UF2, try testing it out by uploading the code to the board.

 

Click the link below to open up the program in MakeCode. Click on the pink edit icon near the top of the title to open the code.

 

This will create a project in MakeCode and allow you to edit, modify and upload the code to the board.

Makecode Blocks

on start block

when the CPX is turned on do the following

 

set accelerometer rage

set motion to a medium setting

 

set strip

setup an external neopixel strip on the A1 pad of the circuit playground express

 

strip set all pixels

setup a color for all the LEDs in the strip

 

set all pixels to

setup a color for all the LEDs on board the Circuit Playground Express

 

set brightness 

adjust the brightness of the LEDs on board the Circuit Playground

 

 

on tilt right

triggers animation when circuit playground express board is tilted

 

play sound

setup  audio sound effect to play

 

strip show animation

set animation on LED strip and duration (in milliseconds)

 

strip show animation

set strip animation and how long to play

 

show animation

set animation on CPX LEDs and duration (in milliseconds)

 

strip stop all animation

stop animations and resets

 

strip set all pixels to

set color back to blue color on LED strip

 

set all pixels to

set color back to blue color on the CPX LEDs

This guide was first published on Jan 25, 2019. It was last updated on Jan 25, 2019.
This page (Code) was last updated on Aug 08, 2020.