Coming from this thread: Smart Mass Air Flow Reader (Aerospace) - Project Guidance - Arduino Forum
I'm wanting several pages to display based on what it touched on the screen, the basics I want are
Start Page > Geometry Selection Page > Diameter Selection Page > Tool Code Selection Page
I have each individual page programmed (see images for better idea)
But I cant see just one page unless I comment out everything. Heres the code I have so far, I'm a quick study, but new to this language. Keep in mind the selections from the previous page need to determine which page displays next.
#include <EEPROM.h>
#include <SPI.h>
#include <GD2.h>
void setup()
{
GD.begin(0);
}
void loop()
{
GD.ColorRGB(0xbfbfbf);
GD.get_inputs();
GD.ClearColorRGB(0x103000);
////PAGE1
GD.Clear();
//Title Page
GD.cmd_text(240, 60, 31, OPT_CENTER, "P R E C O R P");
GD.cmd_button(240-100, 134, 200, 100, 30, 0, "START");
GD.swap();
////PAGE 2
//GD.Clear();
////Geometry Selection
// GD.cmd_text(240, 35, 30, OPT_CENTER, "Select Tool Geometry");
// GD.cmd_button(60, 100, 150, 120, 30, 0, "BC85");
// GD.cmd_button(280, 100, 150, 120, 30, 0, "BC86B");
//GD.swap();
////PAGE 3
//GD.Clear();
////Flute Diameters BC86B
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC86B Flute Diameter");
// GD.cmd_button(40, 60, 120, 50, 30, 0, "1642");
// GD.cmd_button(180, 60, 120, 50, 30, 0, "1882");
// GD.cmd_button(320, 60, 120, 50, 30, 0, "1902");
// GD.cmd_button(40, 130, 120, 50, 30, 0, "2502");
// GD.cmd_button(180, 130, 120, 50, 30, 0, "3107");
// GD.cmd_button(320, 130, 120, 50, 30, 0, "3127");
// GD.cmd_button(180, 200, 120, 50, 30, 0, "3752");
//GD.swap();
////PAGE 4
//GD.Clear();
////Tool Code for BC86B 1642
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC86B-1642 Tool Code");
// GD.cmd_button(240-140, 70, 280, 50, 30, 0, "2.678-.488-CS-1C");
// GD.cmd_button(240-140, 160, 280, 50, 30, 0, "2.902-.712-CS-1C");
//GD.swap();
////PAGE 5
//GD.Clear();
////Tool Code for BC86B 1882
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC86B-1882 Tool Code");
// GD.cmd_button(240-140, 100, 280, 50, 30, 0, "2.902-.712-CS-1B");
//GD.swap();
////PAGE 6
//GD.Clear();
////Tool Code for BC86B 1902
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC86B-1902 Tool Code");
// GD.cmd_button(240-140, 60, 280, 50, 30, 0, "2.678-.488-CS-1C");
// GD.cmd_button(240-140, 130, 280, 50, 30, 0, "2.902-.712-CS-1C");
// GD.cmd_button(240-140, 200, 280, 50, 30, 0, "3.126-.936-CS-1C");
//GD.swap();
////PAGE 7
//GD.Clear();
////Tool Code for BC86B 2502
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC86B-2502 Tool Code");
// GD.cmd_button(240-140, 60, 280, 50, 30, 0, "2.816-.611-CS-1C");
// GD.cmd_button(240-140, 130, 280, 50, 30, 0, "3.067-.862-CS-1C");
// GD.cmd_button(240-140, 200, 280, 50, 30, 0, "3.318-1.113-CS-1C");
//GD.swap();
////PAGE 8
//GD.Clear();
////Tool Code for BC86B 3107
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC86B-3107 Tool Code");
// GD.cmd_button(240-140, 100, 280, 50, 30, 0, "3.095-.880-CS-1B");
//GD.swap();
////PAGE 9
//GD.Clear();
////Tool Code for BC86B 3127
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC86B-3127 Tool Code");
// GD.cmd_button(240-210, 60, 200, 50, 27, 0, "2.678-.488-CS-1C");
// GD.cmd_button(240-210, 130, 200, 50, 27, 0, "2.902-.712-CS-1C");
// GD.cmd_button(240-210, 200, 200, 50, 27, 0, "3.126-.936-CS-1C");
// GD.cmd_button(250, 60, 200, 50, 27, 0, "3.126-.936-CS-1C");
//GD.swap();
////PAGE 10
//GD.Clear();
////Tool Code for BC86B 3752
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC86B-3752 Tool Code");
// GD.cmd_button(240-140, 60, 280, 50, 30, 0, "3.231-1.001-CS-1C");
// GD.cmd_button(240-140, 130, 280, 50, 30, 0, "3.403-1.173-CS-1C");
// GD.cmd_button(240-140, 200, 280, 50, 30, 0, "3.576-1.345-CS-1C");
//GD.swap();
////Flute Diameters BC85
////PAGE 11
//GD.Clear();
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC85 Flute Diameter");
// GD.cmd_button(40, 80, 120, 50, 30, 0, "1642");
// GD.cmd_button(180, 80, 120, 50, 30, 0, "1902");
// GD.cmd_button(320, 80, 120, 50, 30, 0, "2502");
// GD.cmd_button(40, 160, 120, 50, 30, 0, "2502");
// GD.cmd_button(180, 160, 120, 50, 30, 0, "3127");
// GD.cmd_button(320, 160, 120, 50, 30, 0, "3752");
//GD.swap
////PAGE 12
//GD.Clear();
////Tool Code for BC85 1642
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC85-1642 Tool Code");
// GD.cmd_button(240-140, 70, 280, 50, 30, 0, "2.678-.488-CS-1C");
// GD.cmd_button(240-140, 160, 280, 50, 30, 0, "2.902-.712-CS-1C");
//GD.swap();
////PAGE 13
//GD.Clear();
////Tool Code for BC85 1902
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC85-1902 Tool Code");
// GD.cmd_button(240-140, 60, 280, 50, 30, 0, "2.678-.488-CS-1C");
// GD.cmd_button(240-140, 130, 280, 50, 30, 0, "2.902-.712-CS-1C");
// GD.cmd_button(240-140, 200, 280, 50, 30, 0, "3.126-.936-CS-1C");
//GD.swap();
////PAGE 14
//GD.Clear();
////Tool Code for BC85 2502
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC85-2502 Tool Code");
// GD.cmd_button(240-140, 60, 280, 50, 30, 0, "2.816-.611-CS-1C");
// GD.cmd_button(240-140, 130, 280, 50, 30, 0, "3.067-.862-CS-1C");
// GD.cmd_button(240-140, 200, 280, 50, 30, 0, "3.318-1.113-CS-1C");
//GD.swap();
////PAGE 15
//GD.Clear();
////Tool Code for BC85 3127
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC85-3127 Tool Code");
// GD.cmd_button(240-210, 60, 200, 50, 27, 0, "2.881-.666-CS-1C");
// GD.cmd_button(240-210, 130, 200, 50, 27, 0, "3.095-.880-CS-1C");
// GD.cmd_button(240-210, 200, 200, 50, 27, 0, "3.309-1.094-CS-1C");
// GD.cmd_button(250, 60, 200, 50, 27, 0, "3.523-1.308-CS-1C");
// GD.cmd_button(250, 130, 200, 50, 27, 0, "3.726-1.511-CS-1C");
//GD.swap();
////PAGE 16
//GD.Clear();
////Tool Code for BC85 3752
// GD.cmd_text(240, 25, 30, OPT_CENTER, "Select BC85-3752 Tool Code");
// GD.cmd_button(240-140, 60, 280, 50, 30, 0, "3.231-1.001-CS-1C");
// GD.cmd_button(240-140, 130, 280, 50, 30, 0, "3.403-1.173-CS-1C");
// GD.cmd_button(240-140, 200, 280, 50, 30, 0, "3.576-1.345-CS-1C");
//GD.swap();
//BEGIN FLOW TESTING
////PAGE17
//GD.Clear();
// GD.cmd_text(240, 40, 31, OPT_CENTER, "Selected Tool:");
// GD.ColorRGB(0xCD0000);
// GD.cmd_text(240, 100, 30, OPT_CENTER, "BC85-1642-2.678-.488-CS-1C");
// GD.ColorRGB(0xbfbfbf);
// GD.cmd_button(240-100, 134, 200, 100, 30, 0, "Begin Test");
//GD.swap();
}
So I'm guessing I'll need if/then statements for each one of these buttons, indication which screen or page to go to next. So option-tree-esq.