Activity 1: The Circuit Playground

Time: 1 hour

On your own, you will setup the CPX to be ready to interface with MakeCode. Then you will start the activity. We have provided a list of tasks for you to accomplish on the Circuit Playground Express.

Setting Up the Circuit Playground Express

  1. Open MakeCode in Chrome and open or create a new project.
  2. Connect the CPX to the computer via USB.
  3. Press the reset button on the CPX to enter Bootloader Mode. The NeoPixels should turn red briefly followed by contiuous green. If the NeoPixels stay red, your operating system is still installing drivers, and you may need to wait a minute. If the red continues, try using a different USB; the connection may be bad.
  4. Click on the gear in the top right, and click “Pair Device.”
  5. You should see a device called CPLAYEXPRESS or similar. Click on the device name and click “connect.”
  6. To download the code onto the CPX, click “Download” below the simulator on the left.

Using the Online CPX Simulator

  1. Open MakeCode in Chrome and open or create a new project.

  2. As you create code blocks on the right side of your screen, you may test it on the digital CPX on the left of your screen.

Activity

Complete the following coding challenges on your CPX

  1. Make the ring of Neopixels turn red.
  2. Make each Neopixel a different color.
  3. Play an animation on the Neopixel ring.
  4. Change the value of all Neopixels to Red: 129, Green: 216, Blue: 208.
  5. When you shake the CPX, an animation plays.
  6. When you press the A button, the neopixels turn red, and when you press the B button, the neopixels turn blue.
  7. When both A + B are pressed, music (of your choice) plays.

BONUS:

  1. Choose a random number between 0 and 10 when you shake the CPX. If the number is less than 5, turn the neopixels green, else turn the neopixels yellow.

  2. Choose a random number between 0 and 10 when you shake the CPX. If the number is even, turn the neopixels green, else turn the neopixels yellow.

Note: If you are using a physical CPX, make sure to download your code after each challenge to test