Makecode For Circuit Playground Express: Created by Peli de Halleux
Makecode For Circuit Playground Express: Created by Peli de Halleux
Makecode For Circuit Playground Express: Created by Peli de Halleux
Microsoft MakeCode for Adafruit is a web-based code editor for physical computing. It provides a block editor, similar
to Scratch or Code.org, and also a JavaScript editor for more advanced users. Try it now
at https://makecode.adafruit.com/ (https://adafru.it/wmd) !
MakeCode currently supports the Adafruit Circuit Playground Express. For other boards, like the Adafruit Metro M0,
try https://maker.makecode.com (https://adafru.it/BeY) .
Your browser does not support the video tag. Circuit Playground Express
$29.95
IN STOCK
ADD TO CART
MakeCode works for the Express edition of the Circuit Playground, not the Classic.
try our getting started tutorial (https://adafru.it/wmd) that helps you build a siren program
try one of our projects (https://adafru.it/wpD) to learn more about the features of the Circuit Playground.
take a deep dive in the documentation (https://adafru.it/wpE)
Blinky!
Let's show how MakeCode works by building a simple program that blinks the 10 awesome NeoPixels.
Creating a blink effect is done by setting all the ring LEDs to red, pause for a little, then turn them off, pause for a little,
then repeat forever.
Let's gather the blocks we need to convert the description above into Blocks that the Circuit Playground can
understand and run:
forever runs blocks in a loop with a 20ms pause in between (it is similar to Arduinoloop).
show ring sets the color on the 10 neopixels at once
pause blocks the current thread for 100ms. If other events or forever loops are running, they have the opporunity
to run at this time.
Do you want to select or change colors? The show ring block has a built-in color picker. Select the color from the
color wheel to select a color, then click one of the ten Neopixel rings to modify its color.
How do I disable a Neopixel? The grey dot in the middle of the color wheel indicates that the pixel is off. Select the
grey from the color wheel and then click the Neopixel ring.
You can see the Blinky block program in action in the MakeCode editor below. You can also see how the blocks are
"slotted together". Clicking the question marks on the box will pop-up a comment to explain what the block does.
In the next section, we'll load the Blinky code onto the Circuit Playground Express!
Step 1: Connect your board via USB and enter bootloader mode
Step 2: Compile and Download the .uf2 file into your board drive
If it is your first time running MakeCode or if you have previously installed Arduino or CircuitPython, you may
need to double press the reset button to get your board into bootloader mode.
When the Circuit Playground Express is in Bootloader mode, all the LEDs will turn red briefly, then green. Verify your
status LED is also pulsing red. Your computer should show a new removable drive called "CPLAYBOOT"
If the LEDs are all red: Either the computer is still installing drivers (Please wait a minute, Windows takes some time to
install updates.) or you have a bad USB connection. If you keep getting red LEDs - try a new USB cable (you may want
to ensure your USB cable is not charge only, it needs to transfer data) or a different USB port.
We are now ready to compile our blinky code and download it to our board!
MakeCode has a built-in simulator that re-loads and re-runs code when restarted. This is an easy way to both ensure
that our code compiles and simulate it before moving it onto the board. The refresh button re-loads the simulator with
your latest version of block code.
If you receive a "we could not run this project" error, please check over your code for errors.
If your board is working in the simulator, it's time to download it to your actual board! Click the "Download" button. It
will generate a .uf2 file and download it to your computer (UF2 (https://adafru.it/vPE) is a file format designed to flash
microcontrollers over USB).
On a Mac, you can safely ignore the "Disk Not Ejected Properly" notification that may appear after copying
your .uf2 file.
Windows: Open Windows Explorer (Windows key + E key) and locate the "blinky.uf2" file you generated. It's probably
in your Downloads folder!
You can copy/paste the file to your CPLAYBOOT volume or you can drag/drop it like in the GIF below.
macOS: Open Finder and locate the "blinky.uf2" file. You can copy/paste this file to the "cplayboot" volume or
drag/drop it from the same finder window.
If you want to avoid the copying process: You can download your programs directly to the board. To do this: change
the download location in Chrome (https://adafru.it/wHA), Firefox (https://adafru.it/wHB), Safari (https://adafru.it/wHC), or
Opera (https://adafru.it/wHD)to the main directory of your "CPLAYBOOT" volume.
The .uf2 file (CURRENT.UF2) you created by clicking on the Compile button in MakeCode also contains the source
code of your program!
You can open this file in MakeCode by dragging and dropping it into the browser to edit it.
Sharing
You can share your code by clicking on the share button. After confirmation, MakeCode will create a short unique URL
for your code. Anyone with that URL will be able to reload the code.
These URLs can also be used to embed the editor your blog or web pages! Just copy paste the URL in your text editor
and (if it supports oEmbed) it will automatically load it in your page.
Give it a try!
You can also switch between blocks and JavaScript by clicking the button on the top.
https://adafru.it/BAn
https://adafru.it/BAn
Windows Store
The MakeCode for Adafruit Windows Store app.
Node.JS
The (open source) GitHub repo contains instructions to run a local node.js web server with HID flashing and serial
monitoring.
Requirements!
You'll need to do a few things before you can use WebUSB
You will need to use the latest version of the Google Chrome (https://adafru.it/B-S) web browser. Firefox, Safari,
Opera, Edge, etc do not support WebUSB at this time. Only Chrome, only versions 68 or greater!
Run Windows 10, Latest Mac OS X or Linux. Windows 7 or 8 is not supported!
Update Bootloader
You will also need the latest bootloader firmware for Circuit Playground Express (which only needs to be done once).
We ship the newest bootloader on Circuit Playground Expresses as of July 2018 but in case you have an old one, it
doesn't hurt!
https://adafru.it/Bmg
https://adafru.it/Bmg
Updating the bootloader is as easy as flashing a MakeCode program. Simply enter the bootloader by pressing Reset
once (or twice) to get a green ring of NeoPixels. A flash drive called CPLAYBOOT will show up in your operating
system's file explorer/finder. Drag the update bootloader uf2 file you downloaded via the green button to the
CPLAYBOOT drive. This uf2 contains a program which will unlock the bootloader section, update the bootloader, and
re-lock it. It will overwrite your existing code such as CircuitPython or Arduino so make sure everything is backed up!
https://adafru.it/CLL
https://adafru.it/CLL
This is required in order to access the WebUSB functionality from Google Chrome. You only need to do this once, this
first time! After copying this UF2 over, hopefully it'll be the last time you'll drag and drop one to your device!
Pair Device
Once the initial UF2 has been copied over to the flash
drive, click on the cog wheel icon in the top right corner,
next to the Microsoft logo. Find the Pair Device link in
the menu and click it.
Device Paired!
You'll get a nice notification near the bottom of the
screen letting you know the device was successfully
paired. Give it a try and click on the big download button
to upload your code!
GitHub packages
Additional blocks or drivers can be packaged in github repo and loaded in the editor via the Add Package dialog.
Packages can contain JavaScript, C++ and yes! ASM! https://makecode.adafruit.com/packages