Day 13

Cabin Fever Activity Selector

With snow on Halloween in our area, I had flashbacks to the trying winter we had this past year! My girls and their friend helped me create this random activity selector for days that we may be stuck at home.

My helpers were 5 and 8 years old, so the final product shown is with that age group in mind, however, I have shared extension options for students that want to go further or older students.

Materials

This project uses the following materials. If you don't already have a Circuit Playground, but do have a micro:bit, check out the extension ideas for ways to use the micro:bit for this activity instead.

Instructions

  1. We'll be using MakeCode for this project as it was easy for my helpers to engage with and be successful. We used the blocks to code, but students can also switch into JavaScript in this development environment.
  2. Once you are on the MakeCode site, click the Circuit Playground Express option and start a new project.
  3. Have students select a different color for each of the 10 LED lights on the Circuit Playground. We used the "show ring" block under "Lights" to create our pattern even though we never used that block in our code.
  4. There are many ways that students can complete this project, but my helpers decided to have the event to start the program be pressing Button A. To do this, they used the "on Button A" block under "Input."
  5. Next we created a Variable called randomNumber.
  6. We set randomNumber to a random number between 0 and 9 because the LEDs are identified by numbers 0 through 9. The "pick random" input can be found under the "Math" category. See image below for what this block looks like.
  7. Once the random number has been stored in the variable, we used an "if, else" block to run through all of the options, 0 through 9. For each option we set all of the LEDs to off and then turned on and set the pixel at each number to the corresponding color.
  8. The girls helping me added in some of there own optional features to make the project their own. They added in animations and music at the beginning of the program. You can see our whole program at the bottom of this page.
  9. Once our code was ready, the girls traced the Circuit Playground outline onto a piece of paper. They marked where the LEDs were around the outline.
  10. They made a list of things they could do on a snow day or a day that they were stuck inside and listed them on the piece of paper.
  11. Finally, they drew lines from the marks they made indicating where the LEDs are to the corresponding activity.
  12. Follow the directions to download the MakeCode project onto the Circuit Playground.
  13. Disconnect the Circuit Playground from the computer and plug in the battery pack.
  14. Switch on the battery pack and trigger the program (pressing Button A in our example).
  15. Enjoy!
Set random number block

Extension Ideas

  • There is more than one way to create this activity in code. Let students explore their own solution ideas. Use our example code as a reference or guide if students get too frustrated.
  • Have a micro:bit instead of a Circuit Playground? You can use this same concept and adapt it to work with what you have! Instead of using LEDs on the micro:bit, maybe it displays the random number on the LED grid. Or use alligator clips to connect LEDs to the output pins.
  • Have students create multiple activity lists. They can swap out the papers with ideas and use the same hardware and code to switch up their results.
  • Have students comfortable with block coding and ready for type coding use the JavaScript option in MakeCode instead of blocks.
  • Want to go even further? Have students try programming the Circuit Playground through the Arduino IDE or CircuitPython. Instructions for setting up the Arduino IDE and CircuitPython can be found at the corresponding links. They will use the C and Python languages and experience what more of what industry development is like.

Full MakeCode program with blocks

Want a starting point? Download this MakeCode file and drag it onto a new MakeCode project to see what my helpers created!