# 20x5 LED matrix

Hello.
I'm new to physical programming, but I'd like to make one matrix work with Arduino. I have Arduino Mega AT1280.
I think I should use 3 MAX7219 chips and maybe ULN2803.
But then there is coding issue. I have read many topics about programming MAX7219, but I think I still need coding help to get all 3 of them working. I'd like to make some animations also and need little tips about that. Yesterday I played different melodies from different buttons with Arduino and made LED chases. That was simple.
I have some practice with PHP programming so I know a bit about programming logic.

As I said I have 20x5 matrix, each row's cathodes wired together and columns' have anodes wired tohether. So it should be OK with MAX7219 chip. I'm using white LED diodes, they were about 3,2V and drawing 20mA. And also they had a parameter 20000mcd or smth. I think I can limit them to 10mA.

I place order on MAX7219 chips today and hope to receive them in about a week. So far I'm wiring my LEDs and drilling holes for them.

Finally, a question.
Does anybody have experience with Arduino and 3 MAX7219 chips?

I know its commonly used, that's why I chose it. But I want to use 3 of them. I read that there were problems with even 2 chips and RED-GREEN matrixes. So what happens with 3 of them?
Maybe some simple code examples?

If you use normal Led's then you have 100 Leds. If you use dualcolor Leds you have 200 Leds. If you use RGB Led's then you have 300 Leds.

You want create animations with your matrix.
There are two ways to manage it.
The first one is the pattern way.

00111000111000000000
01111101111100001100
00011000111000011110
00111101111100001100
00111101111100000000

It need a lot of memory and is only good for very short animations.
It should be possible to store the pattern on a microSD card and read them step for step into the arduino memory.

The second way is to create special manipulation routines.
First you create two arrays

byte red[100] = 0;
byte green[100] = 0;

In this arrays you store your lightning strength values for every diode.

Then you must program the routines to change this values for your animations.

Can I maybe generate some animations with sound input? Equalizer effect or just random flickering with fade? Then it should not need that much memory and I can just write some algorithm that generates my effect?

3x MAX7219

First: 8x5 LED
Second: 8x5 LED
Third: 4x5 LED
That makes 20x5 matrix. Should I connect LEDs to MAX7219 chip like that?

Row-columm Scanning to control an 8x8 LED Matrix:

It's similar for a 20X5 Matrix.

I think your leds have 3 legs ?

Arduino digital pin's max output current is 40mA. As I have 5 LEDs in a row, I need about 80mA output per pin. MAX7219 outputs 500mA total so that should be enough. Or I should use ULN2803 to drive LEDs after Arduino output? Then I don't need MAX7219 chips. For 20x5 matrix I need 25 output pins, right?

I have white LEDs that have 2 legs. 1 cathode and 1 anode. I wrote that in my first post.

You need 25 output pins. The leds are connected to the MAX7219, he drives the current for the leds.

I don't use the MAX7219, i work with the TLC5940.

For MAX7219 I need 3 pins on my Arduino. If I drive LEDs directly with Arduino, I need 25 pins. But with MAX7219 I need only 3 of Arduino pins. DataIn, Load, Clock.