First we'll get a rainbow animation set up, so when we plug in our lights, they'll do something.
Point your browser at makecode.adafruit.com and then choose New Project.
From here, you can click on any of the colored tabs and drag blocks of code onto your workspace, then preview it using the Circuit Playground Express pictured on the left.
Click LIGHT, and a new tab appears that says NEOPIXEL. Click NEOPIXEL. Drag set strip to create strip on A1 with 30 pixels
out and put it inside your on start
block. If you have more pixels than 30, change this number to however many you have.
Scroll down a bit in the NEOPIXEL tab and find strip show frame of animation
. Drag this into the forever
block.
Now, whatever animation is selected will play on your strip. Let's do one more thing: we have lights on the Circuit Playground too. It's easy to make those light up at the same time.
Under the LIGHT tab, find show frame of animation
and drag it into your forever block.
Anything in the NEOPIXEL tab applies to your attached strip. Anything in the LIGHT tab applies to the lights on the face of the Circuit Playground.
Click DOWNLOAD. The file will download to your computer. Plug in your Circuit Playground with a USB cable, and it appears just like a USB thumb drive -- look for CPLAYBOOT. Drag the file you just downloaded onto the CPLAYBOOT drive, and you're done!
If you don't see CPLAYBOOT, try pressing the tiny black reset button in the center of the board. You're looking for all-green-lights on the face of the board, that's how you know you're in the right mode.
Note: If you see a drive called CIRCUITYPY then press the reset button again (or twice in a row) to get to CPLAYBOOT. If you don't seem to get CPLAYBOOT showing, be sure you have a known good USB cable that has power and data (not the power only ones that come with phone rechargers).
Head over to this Intro to MakeCode guide for more info on getting started with MakeCode. Or, check out the Code Samples page later in this guide for some more project ideas and tutorials.
Text editor powered by tinymce.