rgb 4x4 homemade

hello. i recently made a 4x4 rgb led matrix and i need help with the code. I am thinking that it could be programed as a 4x12 but i am not sure how to do so. i am using common anode rgb leds. and a uln2803 on the ground pins. also i am using an Arduino Mega. any help would be appriciated. Thanks.

This project is a 4 by 4 RGB matrix:-
http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

How have you wired yours up. That will determine how to drive it. Please post your schematic.

this is the same design as mine but mine is a 4x4 rgb or a 4x16 normal.

Well it's not a schematic of what you have so I will have to guess how you extended it.

You have two hardware problems with this.

  1. If you have a resistor in the anode of a common anode LED then the brightness of one colour will depend on what other colours are on. You need to put a resistor in each of the cathodes for each RGB LED.
  2. There is not enough current available from the arduino outputs to drive all the row of LEDs at the same time. You need to put a high sided driver like a PNP transistor or P-channel FET.

The software is simply a matter of :-
a) Turn all the rows off.
b) Put the bit pattern for one row on the columns.
c) Turn on the one row that those bits were intended for.
d) Do nothing or delay for one eighth of the refresh time.
e) repeat a to d for each row.
f) Repeat all above with the same pattern.

For an example of the code see the software in this project:-
http://www.thebox.myzen.co.uk/Hardware/Econo_Monome.html

yes i did realise the resister problem. i have aready fixed that. and i dont plan on have all the leds on at the same time. all i want is a code similar to the one used here http://www.instructables.com/id/Yet-Another-Daft-Punk-Coffee-TableDisplay/step5/Code/ that will work with my setup. also all of the examples you are showing inclued buttons. and also they all use other IC's.

yes i did realise the resister problem

That is why I asked you for your schematic!! ]:slight_smile:

and i dont plan on have all the leds on at the same time

You don't design circuits you can blow up with software errors.

all of the examples you are showing inclued buttons. and also they all use other IC's.

That dosn't matter, just ignore the buttons.

i changed the circuit after i posted. i only plan on using one color at a time, and the example use IC's that i am not.

i only plan on using one color at a time

But there are 8 LEDs that could be on at any instant
The absolute limit of output current for an arduino is 40mA, that is the value that starts doing damage to your board. Suppose you want to run at that level then you are only allow 40 / 8 = 5mA per LED. Have you taken this into account with your resistor calculations? You do not have this problem if you have top level drivers.

the example use IC's that i am not

Are you not up to compensating for that? In place of setting out one row to be high and the others low, it simple accepts a binary number that sends it to a chip to do the same.
Still if you have total disregard for the safety of your arduino then you could look at the example here.
http://www.arduino.cc/playground/Main/DirectDriveLEDMatrix
No doubt you will say your design includes chips that this does not have. It is simply the column is connected directly in place of your pull down buffers.
Please make a effort to understand what is happening in your circuit., it will make the driving software so much easier.