It's simple to program your Twinkly Earwarmer with the Gemma M0 in Microsoft MakeCode! The version to use with Gemma M0 is called MakeCode Maker. It lets you program the onboard color-changing LED, and add components to the board's pins.
For this project, you need to tell the board where to find a strip of four external NeoPixels. Combine them with Gemma's onboard RGB DotStar LED and you can create an animated light show with five lights!
If you haven't used Gemma M0 with MakeCode before, There's more information about using MakeCode on the Gemma M0 guide.
To get started right away, you can just open and edit the sample code shown at the top of the page.
Click the button below to open the MakeCode Maker editor, then add to or change the light display as you wish.
To download the file to the board, connect the Gemma M0 to your computer with the USB cable. Press the reset button and it will go into bootloader mode. That means it's ready to receive code.
Download on the MakeCode page and save the file. It will have a .uf2 extension.
Then find the drive on your computer labeled GEMMABOOT. Drag and drop (or copy and paste) the program into Gemma! You'll know the code was downloaded when the onboard pixel changes to violet.
While the Gemma is still connected to the computer, check how the MakeCode runs on the actual NeoPixel strip so you can make any adjustments.
There are lots of ways to animate your strip of pixels! To create your own animation, you can use the
strip code blocks, found in the LIGHT category. Then you can preview it in the simulator before you download it to your Gemma.
Here's a detailed explanation of how the NeoPixels work and how to make them do interesting things.
You can see and edit the handcoded animation shown above by clicking the button below. Have fun!