Page 4 of 6

Re: HCMAX7219 - LED driver library

Posted: Tue Mar 13, 2018 5:39 pm
by DavidP
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

Re: HCMAX7219 - LED driver library

Posted: Wed Mar 14, 2018 10:00 am
by andrew
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)

Re: HCMAX7219 - LED driver library

Posted: Thu Mar 15, 2018 5:43 pm
by DavidP
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

Re: HCMAX7219 - LED driver library

Posted: Fri Mar 16, 2018 11:13 am
by andrew
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.

Re: HCMAX7219 - LED driver library

Posted: Wed Mar 21, 2018 7:48 pm
by DavidP
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

Re: HCMAX7219 - LED driver library

Posted: Thu Mar 22, 2018 9:42 am
by andrew
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.

Re: HCMAX7219 - LED driver library

Posted: Wed Dec 05, 2018 9:24 am
by PeterB
Hello

I would like to use your 8 digit 7 segment display with an Arduino based milling machine digital readout which is presently working fine with a LCD display. I have got the library installed and I can read an increasing variable on the 7 segment display. However the display reads from left to right and I need it to increment from right to left, ie 00.001 etc and also display a - sign for a decrementing negative number as the machine table moves?

Is this possible? I've looked through the forums for an answer without success, sorry if I've missed it somewhere, one of the problems with being a novice!

Thanks Peter

Re: HCMAX7219 - LED driver library

Posted: Thu Dec 06, 2018 10:59 am
by andrew
I'm not totally sure what it is you need to do but as I have been asked similar questions before I've updated the library (V0.5) with a new print7Seg() member function that give a bit more control over how a number is displayed. Maybe it may allow you to do what you need. Here's an example which you can play around with the numbers to see how it works:

  1. #include <HCMAX7219.h>
  2. #include "SPI.h"
  3.  
  4. #define LOAD 10
  5.  
  6. HCMAX7219 HCMAX7219(LOAD);
  7.  
  8.  
  9. void setup()
  10. {  
  11.   HCMAX7219.Init();
  12.   HCMAX7219.Clear();
  13. }
  14.  
  15.  
  16. void loop()
  17. {
  18.   float Number = -12.3456;
  19.   byte DecimalPlaces = 3;
  20.   byte NumberOfDigits = 8;
  21.   byte Offset = 8;
  22.  
  23.   HCMAX7219.print7Seg(Number, DecimalPlaces, NumberOfDigits, Offset);
  24.  
  25.   HCMAX7219.Refresh();  
  26.  
  27.   while(1);
  28. }

Re: HCMAX7219 - LED driver library

Posted: Thu Dec 06, 2018 2:28 pm
by PeterB
Thanks Andrew, I'll give it a try.

A bit stuck at the moment as I cannot install the 0.5 version into the library as I get the error message "A library named HCMAX7219 already exists" and there doesnt appear to be a way to over write it or delete the original?

Goggling for a solution but this seems to be a problem with Arduino and the IDE?

Re: HCMAX7219 - LED driver library

Posted: Thu Dec 06, 2018 3:36 pm
by andrew
You can either just delete the existing library folder (HCMAX7219) which assuming your using windows should be in My Documents\Arduino\libraries\, restart the Arduino IDE and then install the new library.

Or just overwrite the HCMAX7219.cpp and MAX7219.h files in the above installed library folder with the ones found in the V0.5 zip file you've just downloaded.