OK, we are ready to put this all together into our Circuit Playground Hot Potato sketch. Here's the final result:

Download it, unzip, open it in the Arduino IDE, and upload it to your Circuit Playground.

Note that the definition of the melody has been moved to the file melody.h. This was done mainly to clean up the main sketch. But it also makes it a little more modular, making it easier to swap out the melody for a different one.

How To Play

With the Hot Potato sketch loaded and running on the Circuit Playground you're ready to play. Here's how:

The NeoPixels will be all red at the start (and end) of the game.

 

SHAKE TO START!

The melody will play and random NeoPixels will light up.

 

ZOMG! START TOSSING THE HOT POTATO!!!!

When the melody stops, all the lights will turn red again.

 

GAME OVER.

(shake to play again)

This guide was first published on Apr 05, 2017. It was last updated on Mar 08, 2024.

This page (Hot Potato Code) was last updated on Apr 04, 2017.

Text editor powered by tinymce.