HCMAX7219 - LED driver library

Useful guides, libraries, and example sketches to support our Arduino based products.
DavidP
Posts: 3
Joined: Tue Mar 13, 2018 5:30 pm

Re: HCMAX7219 - LED driver library

Post by DavidP » Tue Mar 13, 2018 5:39 pm

Hello,

I am hoping to use two MAX7219 8x8 LED Matrix in a project I am building. I want to be able to pass an integer value between 1 and 100 to the matrix's and for them to display this number.
Would your library, using the command below, be able to provide this functionality do you know?

HCMAX7219.printMatrix(Value, Decimal_Position, Offset)

To add further detail, I am wanting a single digits i.e. 1-9 to appear on the one matrix and then number 10 or more to appear across the two.

Your comments are very much appreciated.

David

andrew
Site Admin
Posts: 791
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCMAX7219 - LED driver library

Post by andrew » Wed Mar 14, 2018 10:00 am

Yes, if I understand you correctly that will work. Just set the 'offset' column parameter so that your number appears across both displays. If you don't need a decimal point then just use this version:

Code: Select all

HCMAX7219.printMatrix(Value, Offset)
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

DavidP
Posts: 3
Joined: Tue Mar 13, 2018 5:30 pm

Re: HCMAX7219 - LED driver library

Post by DavidP » Thu Mar 15, 2018 5:43 pm

Hi Andrew,

Thank you for your reply I managed to get this to work. do you know where I can amend the pin allocations. I have looked in the .h file and cannot find them. I know we specify the load pin within the program but, I would like to amend the other two pins.

I also have one further question. I would like to use a 4 digit 7 segment display alongside the two 8x8 led matrix, would I be able to control this using your library or could I use an additional library such as https://github.com/avishorp/TM1637 .

Apologies if this is asking beyond that which you would normally help with.

David

andrew
Site Admin
Posts: 791
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCMAX7219 - LED driver library

Post by andrew » Fri Mar 16, 2018 11:13 am

do you know where I can amend the pin allocations
It uses the hardware SPI interface to output the data to the ICs so I'm afraid the clock and data pins can't be changed.
I also have one further question. I would like to use a 4 digit 7 segment display alongside the two 8x8 led matrix, would I be able to control this using your library....
I haven't tested the library in this way but I can't think of any reason why it wouldn't work. Just use the appropriate HCMAX7219.print7Seg() or HCMAX7219.printMatrix() function depending on the type of display your outputting to.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

DavidP
Posts: 3
Joined: Tue Mar 13, 2018 5:30 pm

Re: HCMAX7219 - LED driver library

Post by DavidP » Wed Mar 21, 2018 7:48 pm

Hi Andrew,

I have one final question, I have managed to make my program work, however I want to know if it is possible to change the output of a specific number from the library to the 8x8 matrix. Specifically the number 100, as to make it fit across my 2,8x8 matrix. I hope that makes sense.

David

andrew
Site Admin
Posts: 791
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCMAX7219 - LED driver library

Post by andrew » Thu Mar 22, 2018 9:42 am

I'm not sure if you talking about making the font smaller or making the font proportional so it takes up less columns. In both cases this would require significant modification to the library. For the former you would need to generate a smaller font and modify the library to handle this smaller sized font. Also note that fonts smaller than 8x8 tend to look ugly.

If you mean the latter then you again need to modify the library to handle different width characters and even then without reducing the size of the font a value of 100 still wouldn't fit across two displays.

The only easy options I can think of is to simply scroll the number across the display or, if it's just for the value 100, you could use the HCMAX7219.DisplayBuffer[] function to write your own bitmap for this value directly to the display buffer.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply