Circuit Playground Express “Hello World”

“Hello World” refers to the first program you write on a platform or in a programming language you have never used before. This recipe is a Hello World using the Neopixel LEDs built into the Circuit Playground Express, with a few extra garnishes thrown in.

Ingredients

 

Directions

  1. Go to http://makecode.adafruit.com and start a new project.
  2. On the workspace, you should find a green forever block. Anything you place inside of it will repeat as long as the CPE is powered on.
  3. From the “Lights” set of blocks, select show animation and place it inside of the forever block. Select which of the six pre-set animations you want.
    Untitled_-_Adafruit_Circuit_Playground_Express.png
  4. On the left side of the screen there is a simulation of how your code will run on the real CPE. Check it out, and change the “ms” setting from 500 milliseconds to some other number to see what it does to the animation.
  5. Name the file. Look for the field in the bottom center with the floppy disk image next to it. You can call it “HelloWorld” or whatever else you like. After typing, click the floppy disk Save icon.
  6. Finally, the most technical part – sending your code into the actual CPE. The good news is that you will repeat this part each time you change or write new code so it will become rote and simple for you soon!
    1. Click the big Download button at the bottom left of the screen.
    2. Your code will download, probably into your “Downloads” folder. In Google Chrome (and other browsers) you can click the triangle next to the file you downloaded and choose “Show in Finder” to find it in your downloads folder.
    3. Plug the Micro USB cable into your CPE and into your computer.
    4. Click the reset button on the CPE. The lights should turn red then stay green, and the board will be in programming mode. Your computer will think it is a USB Drive named CPLAYBOOT.
    5. Drag the downloaded file (it will have whatever you named it in the file name) to the CPLAYBOOT disk. The file will transfer and then your program should start running on the CPE!

 

Garnishes

What else can you throw into the forever loop? Try some things from below, following step 6 each time to transfer your updated code to the CPE board for testing.

  • There are other options in the “Lights” blocks. You can change colors in the show ring block by clicking a new color from the center and then clicking an individual light to change its color. Alternating show ring blocks and pause blocks from the “Loops” set will let you create your own animations.
  • Check out the sounds and notes available in the “Music” set of blocks. Try adding one or more of the available sounds to your loop.

 

Leave a comment

Mintz Family iLab Project Blog

Things I've made and helped others make. Stories about creating and messing up.

Kris Swanson dot Blog

Things I've made and helped others make. Stories about creating and messing up.