MAX7219 LordPants' library LedControl giving an error ! help ! [SOLVED]

hello guys,
i will start by this link from which i got the library modified of LedControl for common anode 7-segment
https://github.com/deruiter/DCF77-Analyzer-Clock/tree/master/LedControl%20added%20COMMON%20ANODE%20display%20support

so i copied the code and saved it because i couldn't download it directly from the link, this library belongs to LordPants and this is his post about it

so after i saved i went to my code which worked perfectly before saving it, and test it but i am not using CA for test, i am still using the same old circuit for CC 7segment display

and i added the boolean argument he says to add in LedControl() function

but i received this error :
no matching function for call to 'LedControl::LedControl(int, int, int, int, int)'

so can anyone please help with this ?

New Update:
i am getting this error now :
D:\Arduino/MAX7219_count_with_Potentiometer.ino:12: undefined reference to 'LedControl(int, int, int, int, bool)'

thanks in advance to all :slight_smile:

no matching function for call to ‘LedControl::LedControl(int, int, int, int, int)’

Looking at the LedControl() function in the library the error message is right. The function takes 4 ints as its parameters, not 5.

LedControl(int dataPin, int clkPin, int csPin, int numDevices=1);

Where did the suggestion to add a fifth parameter come from ?

UKHeliBob:
Looking at the LedControl() function in the library the error message is right. The function takes 4 ints as its parameters, not 5.

LedControl(int dataPin, int clkPin, int csPin, int numDevices=1);

Where did the suggestion to add a fifth parameter come from ?

but which file did you look into ? because i looked and found it has a fifth boolean

i removed the original LedControl.h and .cpp files and i put instead the LedControlCA.h and .cpp and of course i named them LedControl.h and .cpp

so i get now this error :
D:\Arduino/MAX7219_count_with_Potentiometer.ino:12: undefined reference to 'LedControl(int, int, int, int, bool)'

so what might be the problem now ?

my sketch file is located on the desktop not inside the arduino reference on D:/

SOLUTION IS:

after downloading the LedControl files of LordPants from github, you must delete the files present name : LedControl.h and LedControl.cpp

then you have to rename LedControlCA.h and LedControlCA.cpp to LedControl.h and LedControl.cpp

then you have to go to the new LedControl.h and add this line with the includes :

#include <common-anode.patch>

and that’s it everything will be fine :slight_smile:

which file did you look into ? because i looked and found it has a fifth boolean

I looked in LedControl.h because that is the file that caused the error.

UKHeliBob:
I looked in LedControl.h because that is the file that caused the error.

yea ok i found the solution it's in the reply #4 :slight_smile: