This is my first serious arduino project, so please be nice ;)
Also, before I begin, I have read a few posts (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1276519590) and so on and understand that I will likely be doing some form of multiplexing to implement the array/matrix (not sure if there is a difference but figured I would cover all my bases). Due to the shear number of ports needed, I am doing this on an arduino mega 2560.
I am going/planning to build a small 9x9 Go (http://en.wikipedia.org/wiki/Go_(game)) board that can automatically score the game. In future versions I hope to be able to add a simple AI, but that is way later.
In Go there are 2 colored pieces, white and black. To further complicate things, in order to sense the pieces and maintain a pleasing aesthetic, I plan on boring small holes on each of the intersections for sensors. I can custom cast some pieces that are semi-translucent (white) and opaque (black). In order to differentiate the two colors in digital form, I figured I would use a photo resistor. The reason this is iffy is because once embedded in the intersection, the only light the resistor will receive is from directly above it. Once a piece is covering it, it will have significantly less light. That is why I decided one piece should be semi-translucent. Not to mention photo resistors can be pretty cheap when bought direct from Shenzhen (http://www.alibaba.com/product-gs/469336185/LDR_PHOTORESISTORS.html). I have thought about using magnets to detect pieces, but I think that these would be less durable than regular casted pieces.
The part I can't wrap my head around is how I am going to differentiate each position (9x9= 81 unique positions) from another. This will be my first foray in to multiplexing, so any help is appreciated. I have been looking at old keyboard detection systems, and I know I will have to be constantly cycling through the 81 positions to check for pieces.
Also, in order for the game to be scored, the scoring algorithm needs to know about unoccupied territory. I have seen that some form of tri-state logic can be made by switching a pin from I to O, but I am not sure if this will work for my specific needs :sweat_smile:. I need some sort of "open" state. I have been thinking that the best way to do this would be to have an 8 bit stuvwxyz response from each position (reaching here, I know), where the s would indicate occupied or not (1/0), and the tuvwxyz could indicate position (unfortunately 9x9 makes 7 bits superfluous, but it wouldn't be a go board if it was only 8x8). This could probably be implemented with the analogRead instruction.
I have only seen one other project like this, and I doubt it will release its schematics:
This project is not released yet, but it has the traditional minimalist style I am looking for.
Obviously this is a big project, so ANY help/criticisms would be immensely appreciated (i.e. you would become a god to me). HUZZAH!