I was hoping there was something obvious that I was missing…
Here is the primary INO (forms4UtftTest.ino):
#include <UTFT.h>
#include <UTouch.h>
// Declare which fonts we will be using
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(ITDB32S, 38,39,40,41);
UTouch myTouch(6,5,4,3,2);
void setup()
{
// For debugging messages
Serial.begin(57600);
myGLCD.InitLCD();
myGLCD.clrScr();
myTouch.InitTouch();
myTouch.setPrecision(PREC_MEDIUM);
}
void loop() {
while (true)
{
if (myTouch.dataAvailable())
{
myTouch.read();
int x=myTouch.getX();
int y=myTouch.getY();
for (int i = 0; i < DEF_MENU; i++) {
if (x >= Def_Menu[i].x && x <= Def_Menu[i].x1) {
Serial.println("Pressed " + Def_Menu[i].name);
}
}
}
}
}
Here is it’s companion that is getting sucked into the compiler behind the above( Forms4Utft.ino):
// Generated by Forms for TFT a companian to www.Form-Builder-for-PHP.com
//
// Enable storage of literals in program space rather than RAM
#include <avr/pgmspace.h>
struct Forms4Utft {
String name;
int x;
int y;
String formatName;
int width;
int height;
String type;
String color;
String backColor;
int round;
};
const int DEF_MENU = 12;
const Forms4Utft Def_Menu[DEF_MENU] = {
{"selStats", 15, 195, "BigFontS", 90, 35, "btn", "000000", " ", 0},
{"selGraph", 215, 195, "BigFontS", 90, 35, "btn", "000000", " ", 0},
{"line2", 15, 185, "", 300, 2, "hline", "000000", " ", 0},
{"line1", 15, 95, "", 300, 2, "hline", "000000", " ", 0},
{"testStatus", 15, 105, "BigFontS", 280, 0, "txt", "000000", " ", 0},
{"header", 15, 5, "BigFontS", 280, 0, "txt", "000000", " ", 0},
{"maxSustainedBar", 15, 160, "", 290, 15, "hline", "000000", " ", 0},
{"selTest20", 115, 35, "7SegNumFontR", 90, 50, "btn", "000000", " ", 1},
{"selTest30", 215, 35, "7SegNumFontR", 90, 50, "btn", "000000", " ", 1},
{"maxSustained", 85, 130, "BigFontS", 200, 15, "txt", "000000", " ", 0},
{"selTest10", 15, 35, "7SegNumFontR", 90, 50, "btn", "000000", " ", 1},
{"obsSec", 15, 130, "BigFontS", 40, 0, "txt", "000000", " ", 0},
};
And the exact error messages:
Forms4UtftTest.cpp: In function ‘void loop()’:
Forms4UtftTest.cpp:33:33: error: ‘DEF_MENU’ was not declared in this scope
Forms4UtftTest.cpp:34:26: error: ‘Def_Menu’ was not declared in this scope