Could you elaborate on what you mean by "data driven structure"?
Making a data-driven structure is … probably more complex than you might want to fool with at this point. It's more the sort of thing you'd do if you had a deep tree of submenus.
With an appropriate set of constructors or builder methods, you'd build up the menus and possibly the screens using sets of declarations
A 'menu' would be a data structure containing an array of menu items. Each item would be either a 'submenu' line or a 'actual input screen' item. Submenu items would have a method allowing the controller code to ask "if someone clicks you, what submenu/page do I display?". The controller code tracks which submenu or page it is currently displaying, and where to return to whne the 'back' button is pressed.
Likewise, a 'page' object might have an array of fields, each specifying a row/column where it is to appear, it's width, a type, and a current value. The controller code would handle the job of talking to your input devices.
But honestly - it's really more than you need.
One thing, however: your code currently redraws each page completely every time it loops. Really, the static parts of the pages only really need to be redrawn when the page changes. This is maybe the main advantage of the data driven approach. This stuff:
if (InHorizontalMenu == 1 && PageVal == 6 && ColumVal == 1) {
if (AxisYv < 25) {
P1HourVal++;
delay(250); //delay between reads so it doesn't change through lines all at once//
}
if (AxisYv > 1005) {
P1HourVal --;
delay(250); //delay between reads so it doesn't change through lines all at once//
}
P1HourVal = constrain(P1HourVal, 1, 12);
}
becomes more like
Field *f = findFieldFor(PageVal, ColumnVal);
if(f != NULL && f->talksToYaxis()) {
int v = f->value;
if (AxisYv < 25) {
v++;
}
if (AxisYv > 1005) {
v --;
}
v = constrain(v, f->min, f->max);
if(f->value != v) {
f->value = v;
redrawField(f);
delay(250);
}
}
I'm rambling. It's 0:20 AM - I'll stop now.