Go Down

Topic: 5x7 LED Matrix Issue (Read 4 times) previous topic - next topic

CrossRoads

These?
http://www.kingbright.com/manager/upload/pdf/TC20-11SYKWA(Ver1292470838.7)
So presumably you are driving the 7 anodes from something with current limit resistors, and sinking the 5 cathodes one at a time to turn on one column at a time?
Or are you  driving only 1 anode high and only 1 cathode low at a time for much slower multiplexing?
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

adamedelberg

It is this one ---> (http://www.kingbrightusa.com/images/catalog/SPEC/tc20-11ewa.pdf)

I am trying to drive each LED independently so I would be able to make a letter or number.


CrossRoads

Okay, one common way to tdo that is to drive all 5 anode hi or low, and pull one cathode, then repeat that for the next 4 columns quickly.
You will define some fonts, Imagine the letter A as a 7 tall x5 wide array with 1 = LED on and 0 = LED off:

1 1 1 1 1
1 0 0 0 1
1 0 0 0 1
1 1 1 1 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1

So assuming an unused 8th bit that is always 0, each column could be represented as
01111111 = 0x7f
01001000 = 0x48
01001000 = 0x48
01001000 = 0x48
01111111 = 0x7f

So now you write some code that sends out a byte of data and 1 cathode control bit every 1mS:
Code: [Select]

void loop(){

// column 1
if (1mS elapsed){
all cathodes off
write anodes with 0x7x
turn on cathode 1
}

// column 2
if (1mS elapsed){
all cathodes off
write anodes with 0x48
turn on cathode 2
}

// column 3
if (1mS elapsed){
all cathodes off
write anodes with 0x48
turn on cathode 3
}

// column 4
if (1mS elapsed){
all cathodes off
write anodes with 0x48
turn on cathode 4
}

// column 5
if (1mS elapsed){
all cathodes off
write anodes with 0x7x
turn on cathode 5
}
} // end loop


Can you follow that?  You are the driving the LEDs for a column at a time, and using persistence of vision to make the eye think any LED can be on at any  time.
You can see how this would fit nicely into a loop, then expand from there to have the fonts predefined in an array where you would call up the letter/number in question, then expand from there to have say 3 letters in a 15 byte array and roll along to pick 5 bytes from that array for display (0-4, 1-5, 2-6, 3-7, 4-8, etc) to give the impression of scrolling text, and put new bytes in as needed to go thru your message...

Here's a video of my 8x32 display doing similar:

http://youtu.be/hwYqgyMc5S4

Scroll test of 8x32 LED matrix. Can hold up to 233 characters in SRAM. Will be ~40 more once I push 5x8 fonts out to PROGMEM.


Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

adamedelberg

Really cool! thanks

could you just explain how i would wire up my matrix board to my arduino?

CrossRoads

#9
Oct 22, 2012, 09:54 pm Last Edit: Oct 22, 2012, 09:55 pm by CrossRoads Reason: 1
7 arduino pins with 220 ohm current limit resistors to the 7 anode pins.
5 arduino pins to 5 inputs on ULN2003A, 5 outputs to 5 cathode pins. Gnd to Gnd, COM is not connected.
Driving ULN2003 input high makes the output go low - only drive 1 input high at a time.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up