Please welcome a new challenger in the world famous PoppyEducation’s Tic-Tac-Toe contest !
While @christophe tried (and succeed ) to handle the game positions by video analysis, I decided to use 9 photoresistors and Snap4Arduino.
Overview :
Because an Arduino board only has 6 analogic inputs, I had to consider my 9 photoresistors as digital devices (True/False). So it was quite difficult to adjust the detection level, but a resistor voltage divider bridge did the job.
Photoresistors :
Behind the scene :
A part of the Snap4Arduino code :
I didn’t mess with the min-max algorithm (maybe I will in a few weeks), I only made the Ergo check the win/loose next position. As you will see, it’s enough to win against my little daughter
To conclude, let’s watch the game !
final code
morpion_v11_good.xml (962.4 KB)