Lessons and the learning game

Build a cornhole scoreboard

An eight-digit scoreboard that knows the real rules of cornhole, with a radio remote for the far board and a fanfare for the winners.

What you build

A scoreboard for the backyard. Enter each team's bags at the end of an inning, from the buttons on the scoreboard or from a remote at the far board, and it works out the score with cancellation scoring, the way the leagues play, until a team reaches 21.

The rules

Each inning both teams throw four bags. A bag in the hole is 3 points and a bag on the board is 1. At the end of the inning the two totals cancel: only the team with more scores, and only the difference. 7 against 5 is 2 points. 3 against 3 is a wash, and nobody scores. The first team at 21 or more when an inning ends wins.

The scoreboard enforces it: a fifth bag for a team is refused, and the win is only checked at the end of an inning.

How it works

Multiplexing. The MAX7219 lights its eight digits one after another, about 800 times a second, so three wires drive 64 LEDs.

Debouncing. Button contacts bounce for a few milliseconds, so a change within 30 ms of the last is ignored.

One command for every input. A button on the scoreboard and a letter from the remote (a, A, b, B or D) both call the same function, so there is only one copy of the rules.

Acknowledged packets. The nRF24L01 waits for the other radio to confirm each packet and retries if it does not, so the remote knows whether a press arrived.

Effects that never block. The fanfare and the flashing final score are stepped through with millis(), so the scoreboard keeps listening to the buttons and the radio throughout.

The course

Build a cornhole scoreboard gets there in six lessons, all on the same wiring:

  1. Big digits: wake the MAX7219, a lamp test, and a count to 21.
  2. Buttons for teams: 1 for the board, 3 for the hole, debounced, with UNDO.
  3. Rules in code: four bags, cancellation scoring and first to 21.
  4. A remote: a second Uno over the radio, with acknowledged packets.
  5. Win effects: a fanfare and a flashing score.
  6. Project: a backyard board: real innings, then build it for your yard.

Every step is checked against the running circuit, apart from the last, where you make the scoreboard your own and share it.