PDA

View Full Version : Minimize Arduino Outputs - 4x4 Two Color



NightrainSrt4
08-03-2010, 09:10 PM
Just to make sure I am heading in the right direction:

To have enough outputs on an Arduino Duemilanove to drive a 4x4 Matrix of LED's independently I would need an LED Driver such as a Maxim MAX7219 correct?

I want to make an electronic 4x4 Reversi/Othello game, which means I would need the 4x4 to be able to drive 2 different colors (and off), and 4x4 matrix of switches. The switches are pretty simple as only one gets accessed at a time so I don't have to worry about ghosting inputs.

But to get the LEDs to light correctly without lighting up ones I do not want lit, and without a slow blinking / pulsing as it goes through the columns, I'd have to use something similar to that kind of driver?

All 16 LED's need to be controlled independently in 3 states: color1, color2, and off. Without a driver (which I would need something similar to address the power issue) I don't see how I could do all this with the Duemilanove's number of outputs.

Just want to make sure I am heading in the right direction. Thoughts?

EDIT: Half my hassle would be relieved by just going with the mega it seems . . . To bad.

crenn
08-03-2010, 11:36 PM
Present a wiring diagram.

Oneslowz28
08-04-2010, 12:44 AM
This http://www.arduino.cc/playground/Main/DirectDriveLEDMatrix

Or

Also look into charliplexing.

Charlieplexing Lib. (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236828458)

and http://hackaday.com/2008/12/03/intro-to-charlieplexing/

and http://hackaday.com/2008/10/24/led-life-and-charlieplexing/

NightrainSrt4
08-04-2010, 11:24 AM
Present a wiring diagram.

I hadn't gotten that far, as it was purely conceptual. I was just trying to work out how to tackle it. It was kind of "Hmmm, that would be interesting. I like reversi. How would I go about this". Maybe I should write a software game version first so I can focus on the basic logic, then figure out a physical implementation, as I doubt I am going to come up with the best/least use of code on the first attempt.

I looked at the Arduino link but only for a bit as I saw the wiring diagram and that would need only one row or column lit up at a time, otherwise it would ghost outputs onto the wrong leds.

Using the interrupt they use seems like that would help alleviate issues, but if the code gets too complex / uses too many cycles then it seems the interrupt would either cause issues or the delay before the display routine gets called could be too high and cause visible blinking / the leds would be blank for a short period between each light up. Didn't look at it for long enough to figure out which of those two would occur.

In the end I should probably just start working on it and figure it out as I go. I tend to have an epiphany when doing these kinds of things sometime during the cooldown period after the inner rage following initial failure.