I've been working with the ili9341 cap touch display recently. There is an active high interrupt pin that goes low when touched.
Here is a simplified version of my code:
Essentially, the program should break out of doing the function compass() when the display is touched. This does happens, but I have to press my finger on the screen for around 1s for that to happen.
However, running this is almost instantaneous:
Could someone please explain what's happening? Just curious.
Here is a simplified version of my code:
Code:
void setup(){
....
}
void loop(){
while(digitalReadFast(IRQ) == HIGH);
delay(1000);
do{
compass(); // print out compass data to display
} while(digitalReadFast(IRQ) == HIGH); // check if display is touched
delay(500); // delay just to make sure it doesn't instantly go back because it's still being touched
}
However, running this is almost instantaneous:
Code:
void setup(){
....
}
void loop(){
while(digitalRead(IRQ) == HIGH);
delay(1000);
do{
compass(); // print out compass data to display
} while(digitalRead(IRQ) == HIGH); // check if display is touched
delay(500); // delay just to make sure it doesn't instantly go back because it's still being touched
}