Pages: [1]   Go Down
Author Topic: 3D TicTacToe on a 4x4x4 LED Matrix  (Read 2876 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First off, while I've done some lurking, this is my first post on the Arduino Forum.  I wanted to send my greetings and thanks for such a great community service!  Also, I'm new to the Arduino and electronics in general, and have only been playing around with both of them for about three months.

Anyway, about 16 years ago I wrote a C program to play 3D 4x4x4 TicTacToe against the computer using gaming AI.  Fast forward to a couple of months ago, and it donned on me that maybe it would actually run on an Arduino.  With ever so slight modification, it did!  Then I thought a great beginning Arduino project would be to craft a 4x4x4 LED matrix and integrate it with my 3D TicTacToe game.  After tens of hours of thinking, designing, reading, assembling, trouble-shooting, and then starting all over again, I have a working prototype.  The main components are an Arduino Uno, a MAX7219 LED display chip and 64 LEDs.

I've begun a blog to describe the project, so that other people will be able to duplicate and improve upon it.  It's currently "in progress" and viewable here: http://www.whatmatters2me.com/?p=229
Youtube video here: http://youtu.be/Zy-1M2qoeCk

What do you think?  How would you improve upon it?  Definitely, the 4x4x4 LED matrix could use some aesthetic improvements.  Also, I'm not sure the best way to select the user moves.  Currently it's using a keypad, but I'm considering using a potentiometer and pushbutton.  The potentiometer would move through the X axis first, then after pushing the button after selecting the X axis, it would switch to selecting the Y axis, etc.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26344
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Joystick for moving? Left/Right, Back/Forth, button press to change level?

accelerometer/gyro in a box, like a wii controller?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26344
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do the LEDs change color (got no sound here)?
Maybe play 3-D Othello?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good ideas!  Especially if I can find a joystick small enough to incorporate on top of the box.  The accelerometer would make it more fun, but I worry about fine control.

The LEDs do not change color.  The X's and O's translate to Blinking and Not-Blinking.  However, my next iteration I was planning on switching to bi-color three-lead LEDs.  Still thinking about how I can incorporate all those leads into my current design.  And I'll probably need to use two MAX7219's.

3D Othello - heh, that would rock.  However, I did that game AI programming back in my younger days.  Not sure if I'm up to that again.  Maybe.

Thanks for the ideas!
Logged

UK
Offline Offline
God Member
*****
Karma: 13
Posts: 903
Twitter: @simonmonk2
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Think big. 3d Chess smiley-wink
Logged

--
My New Arduino Book: http://www.arduinobook.com

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26344
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes Chess, and add a robot arm to move pieces around smiley-cool 
There's a bit of a challenge for you!
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I went to Maker Faire this past weekend.  Besides having an incredible time - I met Mitch the-TV-B-Gone guy and listened to talks by Massimo and Chris Anderson - I picked up a thumb joystick at the Maker Shop there.  It's apparently from Sparkfun (COM-09426) and includes the breakout board.  I'm in the process of figuring out how to add it to my LED matrix TicTacToe.  The joystick has potentiometers for the X & Y directions, and like you suggested I could use the pushbutton for the Z-direction.  But it looks like I'll still need another pushbutton or something to finish the move.

I've added the first part of the build process (Creating the 4x4x4 LED matrix) to my blog at http://www.whatmatters2me.com/?p=269.  Check it out.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've put up a new webpost of the source code for the 3D TicTacToe game. It's the complete Arduino code that controls the LED matrix as well as the gaming AI to play the game. Also makes use of the MsTimer2 library for interrupts allowing the LED 'game cube' to be displayed even while the Arduino is thinking. At the moment it still uses a keypad to input moves, but I'm working on thumbstick control. Let me know what you think!

http://www.whatmatters2me.com/2011/10/3d-tictactoe-3-programming-the-arduino-to-play/
Logged

Pages: [1]   Go Up
Jump to: