It's simple to program an animated infinity mirror on the Gemma M0 in Microsoft MakeCode! Just open and edit the sample code below and add to or change the light display as you wish. Or, create your own program using the strip
code blocks, found in the LIGHT category. You can preview it in the simulator before you download it to your Gemma. There's more information about using MakeCode on the Gemma M0 guide.
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.
Click 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.
Next, you'll attach the lights and the Gemma and finish the box!
Optional: To make your box even fancier, use a Circuit Playground Express instead of a Gemma and add sensors and music to your infinity mirror! If you're new to using MakeCode with the CPX, check out the Adafruit MakeCode Guide.
Text editor powered by tinymce.