I am trying to expand a class for a TFT LCD screen. My objective is to create a few primitive elements and then a "Screen" base class from which I can poly-morph.
Attached is the library I am trying to build on. I added GuiBase.h GuiBase.cpp Button.h and Button.cpp.
The purpose of the GuiBase class is to hold LCD and touch screen objects, along with a few color choices.
The Button class then inherits publicly from the GuiBase class, where it uses the GuiBase members to draw objects on the screen. I tried the below code to test my implementation :
#include <Button.h>
Button b1(0,0,150,100,"Test");
void setup() {
Serial.begin(9600);
Serial.println("Hello");
b1.draw();
Serial.println("World");
}
void loop() {
}
The code compiles, however the seial port does not print (Both "Hello" and "World" does not print), and nothing is drawn on the screen. This to me indicates some sort of hang like a null pointer.
I would appreciate it if someone could please have a look at the GuiBase and Button classes to see where I screwed up. Or if my plan is fundamentally flawed.
Regards
Kerneels
SPFD5408.zip (32.6 KB)