[SOLVED-OOP] Class declaration and how to use it in Arduino with platformio

I get the answer.

I cant put LCD initialization on TFTDisplay constructor. It seems that it must be initialized in setup() so that later I can use it on loop(). Meanwhile at the same time, cmiiw in C, I cant declare an empty reference or a reference without its object.

In order to solve it, I move out Lcd initialization from constructor into method init() which is called in setup().

and wallah, it works. it prints all text.

1 Like