Hello everybody,
In the following simple program, I display "Hello" :
#include <UTFT.h>
#include <avr/pgmspace.h>
extern uint8_t SmallFont[];
UTFT myGLCD(ITDB32S, 38, 39, 40, 41);
void setup() {
myGLCD.InitLCD(PORTRAIT);
myGLCD.setFont(SmallFont);
myGLCD.fillScr(255, 255, 255);
myGLCD.setColor(255, 255, 255);
myGLCD.print("Hello", 10, 10);
}
void loop() {
}
It works fine.
Now, I would like to add a method to the UTFT class. For this I create a child class
#include <UTFT.h>
#include <avr/pgmspace.h>
extern uint8_t SmallFont[];
class UTFT_M : public UTFT {
public:
UTFT_M(byte model, int RS, int WR,int CS, int RST, int SER=0);
};
UTFT_M::UTFT_M(byte model, int RS, int WR,int CS, int RST, int SER) {
UTFT(model, RS, WR, CS, RST, SER);
}
UTFT_M myGLCD(ITDB32S, 38, 39, 40, 41);
void setup() {
myGLCD.InitLCD(PORTRAIT);
myGLCD.setFont(SmallFont);
myGLCD.fillScr(255, 255, 255);
myGLCD.setColor(255, 255, 255);
myGLCD.print("Hello", 10, 10);
}
void loop() {
}
This program compiles but displays nothing. So what is wrong ?
I am sorry, I am a beginner in C++.
Sincerely.
Pierre