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.
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.
(shake to play again)