B4R Question Does anyone have the library for MAX7219cng led dotmatrix ?

vali khandangoll

Active Member
Hi all of you.
I have a Led dotmatrix display with MAX7219cng IC like below.
I tried many libraries but none worked.

If anyone has a library for it with a small sample code please send it.
 

Attachments

  • ۲۰۲۱۰۱۱۶_۲۳۳۹۴۷-1.jpg
    ۲۰۲۱۰۱۱۶_۲۳۳۹۴۷-1.jpg
    103.9 KB · Views: 186

emexes

Expert
Licensed User
I want to show a character in dotmatrix display only.
Did you get this going?

I suspect the easiest way to display that character is to send the 8-by-8 bitmap directly as 8 x 8-bit bytes, eg:

00100100 = 32 + 4 = 36
01011010 = 64 + 16 + 8 + 2 = 90
10000001 = 128 + 1 = 129
10000001 = 128 + 1 = 129
10000001 = 128 + 1 = 129
01000010 = 64 + 2 = 66
00100100 = 32 + 4 = 36
00011000 = 16 + 8 = 24

which will end up looking like:

SetDigitSegments(0, 36)
SetDigitSegments(1, 90)
SetDigitSegments(2, 129)
SetDigitSegments(3, 129)
SetDigitSegments(4, 129)
SetDigitSegments(5, 66)
SetDigitSegments(6, 36)
SetDigitSegments(7, 24)

The chip numbers digits 1-to-8 rather than the more-usual 0-to-7. The library might "fix" this for you.

You could write an intermediate Sub that loads up those 8 digits in one call eg:

SetAllDigitsSegments(36, 90, 129, 129, 129, 66, 36, 24) 'display heart symbol

Once you've got a character displaying using "manual" code then, depending on how many different characters you plan to display, you can either code up the rest of them manually as well, or put some effort into working out how to use the library's character generator code.

edit: Your display might be wired up with bytes as columns rather than as rows. If it is wired up as columns, then your heart will be rotated 90 degrees. One solution is to physically rotate the display 90 degrees so that your heart is upright. Or you could change the wiring. Or you could recalculate those byte values, but: your life will be much easier if the display is arranged in the same format as binary numbers, per the example above.

https://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf
 
Last edited:
Upvote 0

vali khandangoll

Active Member
Did you get this going?

I suspect the easiest way to display that character is to send the 8-by-8 bitmap directly as 8 x 8-bit bytes, eg:

00100100 = 32 + 4 = 36
01011010 = 64 + 16 + 8 + 2 = 90
10000001 = 128 + 1 = 129
10000001 = 128 + 1 = 129
10000001 = 128 + 1 = 129
01000010 = 64 + 2 = 66
00100100 = 32 + 4 = 36
00011000 = 16 + 8 = 24

which will end up looking like:

SetDigitSegments(0, 36)
SetDigitSegments(1, 90)
SetDigitSegments(2, 129)
SetDigitSegments(3, 129)
SetDigitSegments(4, 129)
SetDigitSegments(5, 66)
SetDigitSegments(6, 36)
SetDigitSegments(7, 24)

The chip numbers digits 1-to-8 rather than the more-usual 0-to-7. The library might "fix" this for you.

You could write an intermediate Sub that loads up those 8 digits in one call eg:

SetAllDigitsSegments(36, 90, 129, 129, 129, 66, 36, 24) 'display heart symbol

Once you've got a character displaying using "manual" code then, depending on how many different characters you plan to display, you can either code up the rest of them manually as well, or put some effort into working out how to use the library's character generator code.

edit: Your display might be wired up with bytes as columns rather than as rows. If it is wired up as columns, then your heart will be rotated 90 degrees. One solution is to physically rotate the display 90 degrees so that your heart is upright. Or you could change the wiring. Or you could recalculate those byte values, but: your life will be much easier if the display is arranged in the same format as binary numbers, per the example above.

https://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf
thanks.
how can I use setchar ?
 
Upvote 0
Top