Hello,
I have a 5" TFT SSD1963 display and I am trying to implement a user interface with the UTFT library for one of my sketched. However, I have run into problems when using a UTFT object nested within other classes. By now, I have narrowed the problem to the following proof of principle:
#include <UTFT.h>
class UserInterface {
public:
UserInterface(void);
void Display(void);
private:
UTFT _display;
};
UserInterface::UserInterface(void) {
UTFT _tmpDisplay(18);
_display = _tmpDisplay;
_display.InitLCD();
_display.fillScr(255,127,0);
}
void UserInterface::Display(void) {
_display.setColor(255, 255, 255);
for (int i = 0; i <200; i++) {
_display.drawPixel(i, i);
}
}
void setup() {
UserInterface ui;
ui.Display();
}
void loop() {}
This works absolutely fine. However, whenever I remove "UserInterface ui;" from Setup() and put it outside any function to have it available globally, I only get weird things on my TFT and I have no clue why that is the case.
Any help would be appreciated...
Thanks a lot in advance!
dodgerts