Controller

The controller is the brain of the puzzle. It holds the story and coordinates the solutions of puzzles. It has no game play of itself. It will start a puzzle and regularely check to see if the puzzle is solved. If it is solved, the game moves to the next puzzle.

The controllers and the puzzles use a state machine that will allow specific functions when in a specific state.

  • GAME_STATE_INIT, the puzzle is in an empty state and can receive a solution.
  • GAME_STATE_READY, the puzzle has a valid solution and can be started.
  • GAME_STATE_RUNNING, the puzzle is running with its specifice game code.
  • GAME_STATE_FINISHED, the puzzle is solved and can be restarted. The code is as generic as possible. Only the loading of a solution and the running of the game is specific for every puzzle.

Build

The controller will be based on an attiny3216, mostly to remain hardware-compatipe with the puzzles. The PCB will be as generic as possible, so its design can easily be reused for other puzzles.

The controller PCB will have a 120 Ohm terminator resistor for the RS485 bus. Due to the very short distances between boards (25 cm) and the low baudrate (9600 baud), the reflections in the signal wires will be minimal.

Bill of Materials

1 x Button (big red with LED) 1 x LCD 16x02 characters
1 x PCB
1 x Attiny3216
1 x MAX485
1 x 1206 resistor 0 Ohm 2 x 1206 resistor 330 Ohm
1 x 1206 capacitor i uF 1 x 1206 LED (red)
2 x 01x02 pinheader SMD (for UPDI and buzzer)
1 x 01x04 pinheader SMD (for serial)
1 x 01x06 pinheader SMD (for misc stuff)
1 x 01x08 pinheader SMD (for display)
1 x 02x03 pinheader SMD (for RS485)

PCB

PCB
PCB

Files

The PCB can be found here:

The code can be found here: