I am working on a project with touch LCD screen using the UTouch.h library.
Basically I am trying to detect a button, but I cant use a while statement because I need my program to run in the background without refreshing the screen.
So I am trying to do something like:
if(myTouch.dataAvailable() == true) {
myTouch.read();
x=myTouch.getX();
y=myTouch.getY();
if(x >= 250 && x <= 293 && y >= 99 && y <= 119)
{
if(button1State == false) button1State = true;
if(button1State == true) button1State = false;
}
}
Its not working though. Any tips?