Tic-Tac-Toe Robot

I’m taking a class on programming for embedded systems, and our most recent assignment was to build and program a tic-tac-toe board with an Arduino. My finished project is above: nine lights which can be lit either green or orange independently (though they’re wired on a grid system, so I have to flash through them to light more than one at a time), and two buttons (one to choose a move and one to play it).

As you can see, it’s fully capable of setting itself up to win and blocking the user’s attempts (the computer player is orange). In fact, I’m pretty sure the AI is unbeatable; beyond more basic play, it defends against the user’s attempts to set up a win in two directions at the same time, and it can even attempts these setups itself.
Though I won’t post the Arduino source for the program (it’s a school project, so collaboration policies, etc.), I have posted a Python version of my AI on GitHub, including a more detailed description of the AI design. If you’re interested in this sort of thing, you should check it out.