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
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.
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.
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.