Secret Maze 2 Pushes ATtiny85’s Limits
David Johnson-Davies’ Secret Maze 2 uses charlieplexing to drive nine IO elements.
The Secret Maze 2, by Technology's David Johnson-Davies, presents a simple maze where walls are represented by four on-PCB LEDs. You can move right, left, up, or down via four buttons, and if you try to traverse in the wrong direction a buzzer provides an audible “wrong way” notification.
While an interesting game, and an improvement on the original Secret Maze and Secret Maze PCB, readers with ATtiny85 experience will note that these chips only have five IO pins — or six if you’re willing to sacrifice the reset. So how is this device able to interface with nine discrete IO elements? The answer: charlieplexing.
Although charlieplexing is largely known for its ability to increase the number of LEDs controlled by IO pins through the use of tri-state logic, it can also be used to read buttons. Here four LEDs are charlieplexed, with four buttons thrown into the matrix (with non-illuminated button diodes to allow for multiple simultaneous button pushes). The buzzer takes up its own GPIO pin, leaving four IO to handle the mixed button/LED IO setup.
The project may be interesting for its ‘plexing explanation alone, but the puzzle portion appears to be nicely implemented as well. Six built-in 16x16 mazes provide a default challenge, and users can create and load custom mazes with the help of the Piskel sprite editor. If you’ve been contemplating creating your own electronic challenge using minimal hardware, Johnson-Davies' project would certainly be a great place to start for inspiration!