HCMAX7219 - LED driver library

Useful guides, libraries, and example sketches to support our Arduino based products.
al5ki
Posts: 3
Joined: Fri Oct 27, 2017 1:32 am

Re: HCMAX7219 - LED driver library

Post by al5ki » Fri Oct 27, 2017 10:11 am

Hi Andrew, that was brilliant recall and has solved the problem (mostly).

The sketch now compiles and uploads, but I get this error still.
/home/al5ki/Arduino/libraries/HCMAX7219/Examples/HCMODU0082_Serial_7_Segment_Module_Example1/HCMODU0082_Serial_7_Segment_Module_Example1.ino: In function 'void loop()':
/home/al5ki/Arduino/libraries/HCMAX7219/Examples/HCMODU0082_Serial_7_Segment_Module_Example1/HCMODU0082_Serial_7_Segment_Module_Example1.ino:66:35: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
HCMAX7219.print7Seg("HELLO !!",8);
____________________________^
Thanks again.

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

Re: HCMAX7219 - LED driver library

Post by andrew » Fri Oct 27, 2017 11:18 am

I still can't test this on a Linux computer at the moment but try this....

In the HCMAX7219.h file find this line (somewhere around line 288):

Code: Select all

void print7Seg(char TextString[], unsigned int Offset);
and change it to this:

Code: Select all

void print7Seg(const char* TextString, unsigned int Offset);

Also in the HCMAX7219.cpp file find this line (somewhere around line 53):

Code: Select all

void HCMAX7219::print7Seg(char TextString[], unsigned int Offset)

and change it to this...

Code: Select all

void HCMAX7219::print7Seg(const char* TextString, unsigned int Offset)

Remember to save both files.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

al5ki
Posts: 3
Joined: Fri Oct 27, 2017 1:32 am

Re: HCMAX7219 - LED driver library

Post by al5ki » Fri Oct 27, 2017 11:25 am

Wow, perfect, even down to the line numbers!!

All fixed, thank you very much Andrew.

Kolki
Posts: 10
Joined: Mon Oct 09, 2017 8:31 pm

Re: HCMAX7219 - LED driver library

Post by Kolki » Fri Oct 27, 2017 1:13 pm

Andrew,
Thanks for the reply,I understand now how it works from left to right.
I have one last question, wh is it not adressing the first 32 positions in the chain.

Regards.
Albert

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

Re: HCMAX7219 - LED driver library

Post by andrew » Fri Oct 27, 2017 2:26 pm

I have one last question, wh is it not adressing the first 32 positions in the chain.
By the first 32 positions do you mean the left most (indexes 64 to 96), or the right most (indexes 1 to 32)?
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Kolki
Posts: 10
Joined: Mon Oct 09, 2017 8:31 pm

Re: HCMAX7219 - LED driver library

Post by Kolki » Sat Oct 28, 2017 11:46 am

Sorry ,
I mean the indexes from 32 to 96.
It display's everything at the right position.
From index 1 to 32 it display's nothing.

From 32 to 96 is 64 positions, with is 8 times Max7219, with is the standard number of chips,if I read the manual rigfht,
It looks like the buffersize is not expanding to the right size for 12 chips.

regards Albert

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

Re: HCMAX7219 - LED driver library

Post by andrew » Sun Oct 29, 2017 8:16 am

8 is an intriguing value for it to stop working at but I don't see any limitations in the library. When I'm back in the office tomorrow I'll get an Arduino hooked up to a scope or logic analyser to see if it's actually pushing the data out of the pin. This will at least confirm if it's a software or hardware issue.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Kolki
Posts: 10
Joined: Mon Oct 09, 2017 8:31 pm

Re: HCMAX7219 - LED driver library

Post by Kolki » Sun Oct 29, 2017 10:02 am

Thanks,have a nice sunday.

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

Re: HCMAX7219 - LED driver library

Post by andrew » Thu Nov 02, 2017 3:54 pm

Sorry for the delay in getting back to you, it's been a busy week and checking the library took a lot more time than I anticipated...

I've taken a good look at the code and I can't see any issues with it. I have however noticed the refresh function, which is responsible for writing the buffer to the display registers in each driver, could be improved and made more efficient. I've now updated the library to V0.4 with this improvement and also a fix for a previous posters issue. This has now been uploaded to the first post (I've not updated github yet so don't download it from there). I don't expect it to fix your problem as I couldn't see anything wrong with the previous version but I've check this new version on a logic analyser and I can see it's defiantly writing to all 12 drivers. Could you give this new version a check just in case it fixes your problem.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Kolki
Posts: 10
Joined: Mon Oct 09, 2017 8:31 pm

Re: HCMAX7219 - LED driver library

Post by Kolki » Thu Nov 09, 2017 2:06 pm

Sorry Andrew,
As you expected the new download did change anything,in the meantime i have ordered a new set off display's so i can do a good test on my wyring
to see if there is a problem somewhere,
Thanks for your help and i stay in tutch.
Regards
Albert

Post Reply