Puzzle game project

Hi there!

We are two complete beginners in electronics and try to build a little puzzle game. Sorry in advance for any stupid noob questions.

So our goal is to have a bunch of puzzle pieces that can be connected to each other. One should be able to connect the pieces in a tree-like manner like this:

http://i67.tinypic.com/156tt0n.png

Every piece has a certain type (a, b and c in this example). The connection to the computer should be done via USB. The computer should then get the tree structure like:

*((((|b|)|c|)|b|((|a|)|a|(|c|)))|a|)# (inorder traverse)

What we did so far is:

  • We planned to use an attiny85 for every puzzle piece

  • Every piece has 3 connections on the one side (vcc, ground and serial data) and 3 or 6 (in case of a branch) on the other side.

  • Thereby the pieces are connected in parallel

The attinys are programmed to wait a short delay, if they have a child node sending data. If not, they send their id to their predecessor. If a predecessor gets data from a child it merges it’s own identification inside and sends it to its predecessor.

After a lot of trial and error we managed to get three of those pieces on our breadboards which send the correct string to our computer (via an arduino uno). The question is how stable this setup is when the tree gets larger. We had a lot of problems with data loss and corrupted strings. Also we have several newbie questions:

How many of those can be connected to an arduino uno without overpowering the arduino ports (the attinys are connected in parallel)? Is there maybe an easier way to detect which piece is connected where? We don’t want to use an optical detection of the pieces or that someone needs to put them on a special board or something. Do you know of a similar project with multiple microcontrollers?

Every help will be highly appreciated :slight_smile: