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 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, follow this guide if you'd like to try that option.
To get started, we'll need to head over to the Adafruit MakeCode website and follow the steps below.
- Plug in your Circuit Playground Express with a USB Cable
- Press the RESET button. Green light means you're ready to MakeCode
- Download the UF2 file and drop it onto CPLAYBOOT.
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 pnik 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.
Let's break down the project and walk through setting it up one block at a time. We'll start with using the interface. On the far left side is an image of the CPX board. This is the CPX simulator. You can use it to test your code. It's interactive, try clicking on the buttons and pads. Right next to it is a menu with colored blocks. Each is section that contains several functions that are associated with the sections title. For example, the "LIGHT" blue color menu has all things pertaining to the RBG NeoPixel LEDs.
We've created basic momentary inputs that trigger both sounds and lights. This behavior should feel familiar. Think about how an electric piano works, as you hold down a key, the note keeps playing and stops as soon as the key is released. There's similar functionality in buttons from gamepads and keyboards. Now you can change the on block from "Button A" to any of the pads (A1 – A7). These pads are capacitive touch enabled, so you can touch them to trigger sounds and lights. Attach alligator clips to them and plug them into any electrically conductive material such as fruit, play doh, copper tape or aluminum foil.