The basic premise is that there are two game “wells” side by side, representing players “H2O” and “JOE” (water and coffee). Pressing a button starts the corresponding timer/game. When running, sequences of tiles (“tetrominoes”) automatically appear and drop into place. Mostly the sequences are “good”, the tetrominoes fit together and rows of blocks are cleared. However, around once a minute, a “bad” sequence is played, the tetrominoes don’t fit, and a row of blocks (with a couple of gaps) accumulates.
The time elapsed since the game was started (since the button was pressed, since the last water or coffee run) is shown by the height of the pile of blocks at the bottom of the well.
There are two times associated with each beverage, a basic repeat interval and a warning period. So for example water may have a repeat time of 7mins, with an additional warning period after that of 3mins. Accumulated rows up to the repeat time are coloured according to the beverage, blue for water and green for coffee (brown never looked very convincing). Rows corresponding to the warning period are coloured yellow, rows after/above that are red.
The corresponding push-button’s LED pulses in the warning period and blinks when overdue. The buzzer also makes warning and overdue noises.
The tetromino drop sequences are pseudo-randomly selected from two pools of predefined scripts, “good” and “bad”. Note that I pondered, but did not bother with, tweaking the code/scripts to add tetromino rotation or translation.
A notepad page showing development of scripts:
I prototyped with the LCD shield attached to a Uno via another shield (to give access to the pins for the push-buttons). The LCD doesn’t have mounting holes. In another project (FlipClock) I worked around this by attaching the entire stack to a back plate via the holes in the Uno then attaching a front plate via long standoffs going from back to front, going past (outside) the stack. This worked because the LCD just floated behind the front plate.
For the final version I took a blank shield board and attached a Nano to it to greatly reduce the depth of the whole assembly. I wanted the LCD to rest inside a cut-out in the enclosure’s front plate. But I could not be confident of measuring the distances from the LCD corners to the Arduino board holes with enough accuracy to work in a laser-cut case. Although I could accurately measure the depth of the assembly. My solution was to add an additional “clamp” plate. This has generously sized holes in the Arduino arrangement, placed as accurately as I could. The LCD “floats” in a cutout in the front panel and is clamped at the back to the intermediate plate inside the case.
The back of the clamp plate:
Getting good photos of the screen is hard. I modified the sketch to optionally send the LCD commands and data out the serial port. I wrote a small Python program to read in a file of the serial output and re-create the image. Here's a screen capture. Coffee has been running for about 12mins and is the warning (yellow) zone. Water has been running for 3 minutes.
The LCD is something like this
See also the Flickr album
Too many customers were playing with it, they had to add this :-)