Sorry for being confusing, I'm not sure exactly what I want so I don't know how to ask. Here is a good way of explaining it. I followed your link and found this:
" For example, if you are cooking dinner you may put the potatoes on to cook for 20 minutes. Rather than staring at the clock for 20 minutes you might set a timer, and then go watch TV. When the timer rings you "interrupt" your TV viewing to do something with the potatoes."
This is exactly what I want to do.
I want to keep refreshing the screen until it senses another press on the screen and does what that press asks.
Here is my code that is relevant, it's not well commented as of right now, I started this project at 5:00pm yesterday and now it's 1:20am.
void loop()
{
digitalWrite(13, HIGH);
Point p = ts.getPoint();
digitalWrite(13, LOW);
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
// we have some minimum pressure we consider 'valid'
// pressure of 0 means no pressing!
if (p.z > MINPRESSURE && p.z < MAXPRESSURE)
{
p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0);
p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0);
if (p.x > 270) { // the top bar is being touched
if (p.y > 0 && p.y < 60) { // the first tab on the top bar is being pushed
if (page != 1){
tempscr(); //load the temperature screen
page=1;
}
}
else if (p.y > 60 && p.y < 120) { // the second tab on the top bar is being pushed
if (page != 2){
ampscr(); // load the amperage screen
page=2;
}
}
else if (p.y > 120 && p.y < 180) { // the second tab on the top bar is being pushed
if (page != 3){
physcr(); // load the physical screen
page=3;
}
}
else if (p.y > 180 && p.y < 240) { // the second tab on the top bar is being pushed
if (page != 4){
prefscr(); // load the preferences screen
page=4;
}
}
}
}
// REFRESH
if (page == 1) // if the current page is the temp page
{
clearcenter(); // clear the area where the old data is
retemp(); // print the new data
}
else if (page == 2)
{
reamps();
clearcenter();
}
else if (page == 3)
{
clearcenter();
rephys();
}
else if (page == 4)
{
clearcenter();
repref();
}
}
That is what I currently have. It refreshes very quickly (I would say around 1-1.5 times a second) and when I press to go to another tab it just keeps refreshing unless I rapidly press another tab and catch it between refreshes.