5x5 led matrix with 2 74hc595

Hello, i made a led matrix 5x5 leds.
i want to use 2 74hc595 shift-registers (i have some 74hc165 here to)

is it possible to help me out how to control the rows and collums with the registers, i'm a noob.
i want use follow code for it, but its for a 8x8. (in attachment)
is it also possible to make the lines for the letters as B00001, in the code its like 0x00, 0x22 etc

sprites.h (9.55 KB)

led_matrix_scrolling_text_by_rows.pde (10.4 KB)

Hello,

I'm not sure you can control 25 LEDs with 2 8bits shift registers, so I will even not try to answer this, maybe someone else can :slight_smile:

As for converting hex to binary, it isn't hard and you don't even need a calculator, look how it's simple to do it manually:

Exemple for letter 'A':

B00000000,    // ________   A
B00011000,    // ___XX___
B00100100,    // __X__X__
B00100100,    // __X__X__
B00111100,    // __XXXX__
B00100100,    // __X__X__
B00100100,    // __X__X__
B00000000     // ________

0 = _
1 = X

(i have some 74hc165 here

The problem with those is that they have no data latch and so you will get intermediate logic states on the outputs while shifting out. This will look like ghosting on supposedly unlit LEDs.

Before any one can tell you what code to use you have to know what way you are going to wire things up, do you have that information?
This is the sort of thing you have to do to multiplex a matrix:-
http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html
the same principle applies no matter how big it is.

i made mine so:

but with the positive side to resistor to the 74hc595
and the negative side to npn like this

the base to resistor to 74hc595 and collector to negative side of the leds and emiter to ground.

So you have this matrix.
You connect the Anodes to the output of 1 shift register.
You connect the transistor bases to the output of the other shift register.

You shift out the anode data, you turn on one transistor, wait 2mS, turn it off
You shift out the next anode data, you turn on the next transistor, wait 2mS, turn it off
repeat 3 more times.

If you keep the anode data as 5 bytes of data (or a small array), you can have a function that updates the matrix every 2 mS, and a different function that updates the 5 bytes every 100mS.

the electrical scheme is right what you made. how do i integrate the above project in it? or is it not possible?

Easily possible.
Shift data into anod shift register, shift B00000001 into the cathode shift register
After 5mS:
Shift data into anod shift register, shift B00000010 into the cathode shift register
After 5mS:
Shift data into anod shift register, shift B00000100 into the cathode shift register
After 5mS:
Shift data into anod shift register, shift B00001000 into the cathode shift register
After 5mS:
Shift data into anod shift register, shift B00010000 into the cathode shift register
After5mS:
Repeat from the top.
Use millis() to check the time going by. During the 5mS between pairs for shifts, do other stuff, like check for serial data, manipulate the data to be shifted into the anode shift register, etc.

i dont understand at all :s

Then read this, it tells you what you are trying to do.

http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

After reading it go back and try and understand what Crossroads is telling you.