Hello,
very much stuck with this so please some advise.
Situation:
I made a program which prints on a 20-4 display big characters (4-4).
The program is working fine but, as I want to use this functionality into an other program I want to transfer it into a library.
The good:
My first attempt with a very simple header and no classes did work perfect.
The header looked like this:
#ifndef BigPatch_h
#define BigPatch_h
#include <Arduino.h>
void BigFontInit();
void PrintBigPatch (int patchnummer, byte patchletter);
void LoadChars();
void PrintBigNumber (byte number, byte col);
#endif
With this header and .cpp file all is fine.
To me this means that the program and lib_functionality is working fine, no errors in that.
The Bad:
And now I'd like some help as I can not figure this out.
I want to make a better library with classes so I changed the header to:
#ifndef BigPatch_h
#define BigPatch_h
#include <Arduino.h>
class BigPatch
{
public:
BigPatch(); //constructor
void Init();
void PrintBigPatch (int patchnummer, byte patchletter);
private:
void LoadChars();
void PrintBigChar (byte number, byte col);
};
#endif
(*note that some name_changes occured but that is all fine)
I just pick out 1 function I made in the .cpp : the init()
void BigPatch::Init() {
lcd.init();
lcd.backlight();
lcd.clear();
//BigPatch.LoadChars(); uncomment this just as a first test
}
And, finally the main .ino program (just a part of it):
#include "BigPatch.h"
BigPatch Big(); // make constructor Big
and in the setup I put
Big.Init();
And here is where it all goes wrong:
the compiler says
request for member 'Init' in 'Big', which is of non-class type 'BigPatch()'
And that is what I do not understand as my Init function is available in the header and available in the .cpp program but it still says it's not a class of BigPatch.
Anyone a light to shine on this?
Thanks!