Greetings.
First of all, let me know if there is an appropriate forum to ask this question because I can’t find any and bit frustrated to find an answer for it
My Working Code:
#include <LCDWIKI_GUI.h>
#include <LCDWIKI_KBV.h>
LCDWIKI_KBV my_lcd = LCDWIKI_KBV(ILI9481, 40, 38, 39, 44, 41);
void loop() {
my_lcd.Init_LCD();
my_lcd.Fill_Screen(0x0);
my_lcd.Set_Rotation(1);
....
my_lcd.Print_String("Hello World", left, 25);
my_lcd.Set_Text_Size(2);
....
It prints this “hello world”… I refactored it into 2 classes called TftDisplay.h and TftDisplay.cpp They are on src/tft/ directory.
TftDisplay.h
....
class TFTDisplay {
public:
TFTDisplay();
void showTitle();
private:
LCDWIKI_KBV my_lcd = LCDWIKI_KBV(ILI9481, 40, 38, 39, 44, 41);
}
TftDisplay.cpp
TFTDisplay::TFTDisplay() {
...
this->my_lcd.Init_LCD();
this->my_lcd.Fill_Screen(0x0);
this->my_lcd.Set_Rotation(1);
}
void TFTDisplay::showTitle() {
my_lcd.Print_String("Hello World", left, 25);
my_lcd.Set_Text_Size(2);
....
}
main.cpp
...
#include <tft/TFTDisplay.h>
TFTDisplay my_tft = TFTDisplay();
void setup() {
...
}
void loop() {
my_tft.showTitle();
}
main.cpp can be compiled w/o any error. But I can’t see “Hello world” printed in LCD.
I am using LCDWIKI and LCDGUI which are copied manually into .platformio/lib directory.
Someone can give me a hint what goes wrong? Or maybe a hint a forum that can help me find my answer?
Thanks in advance.