Code with MakeCode

Here's the finished code, ready to be customized and uploaded to your Circuit Playground Express.

What it Does

This code works just like a chess clock: there is a 15 second timer that lights up in red attached to button A, in blue on button B, in yellow on touch pad A2 and green on touch pad A5.

Pressing any of those four inputs will start that player's timer. If the timer runs out, a "wawawawa" sound plays and the lights blink in that player's color. Pressing any of the inputs will reset the timer and start a new timer in the new player's color. 

How to Upload to your Circuit Playground

Click "Download" below to download the code as-is. Plug your Circuit Playground into your computer's USB port and upload by dragging the file you just downloaded onto the CPLAYBOOT drive that appears. (Don't see it? Try pressing the reset button in the middle of the board)

Customizing the Code

Or, click the edit button in the top right corner below to open the code in MakeCode so you can edit it and customize your colors and timer length.

Look in the on start block to choose timer length (the timer variable) or player colors (color1, color2, color3 and color4). Click the Download button when you're done, and drag the resulting file onto the CPLAYBOOT drive that appears when you plug in your Circuit Playground Express via USB cable.

This guide was first published on Mar 25, 2020. It was last updated on 2020-03-25 15:34:33 -0400. This page (Code with MakeCode) was last updated on Mar 30, 2020.