KrisKasprzak
Well-known member
All,
I'm using some 2.8" TFT displays with my Teensy 3.2 and can get them working with touch, buttons, SD,etc. However I have several places that i want to be able to push a button on the screen (to trigger some event) but can only seem to trap a screen button push with a polling function--which means such function must be placed like everwhere in my code, yuck.
I was hoping to use the displays IRQ pin conneted to an interrupt pin on my teensy (say pin 4) to trigger an interrupt function. That way no matter where the code is, user can always push a button on the screen for some action to happen.
My display
https://www.amazon.com/Wrisky-240x3...qid=1510373771&sr=8-10&keywords=240+x+320+tft
I've tried everything, maybe the IRQ pin on the display is not for such purpose? I tried using the displays MISO pin to trigger an interrupt--still no luck.
I'm using some 2.8" TFT displays with my Teensy 3.2 and can get them working with touch, buttons, SD,etc. However I have several places that i want to be able to push a button on the screen (to trigger some event) but can only seem to trap a screen button push with a polling function--which means such function must be placed like everwhere in my code, yuck.
I was hoping to use the displays IRQ pin conneted to an interrupt pin on my teensy (say pin 4) to trigger an interrupt function. That way no matter where the code is, user can always push a button on the screen for some action to happen.
My display
https://www.amazon.com/Wrisky-240x3...qid=1510373771&sr=8-10&keywords=240+x+320+tft
I've tried everything, maybe the IRQ pin on the display is not for such purpose? I tried using the displays MISO pin to trigger an interrupt--still no luck.
Code:
void setup() {
... all the code to get display working ommitted, but what I have works fine
attachInterrupt(4, ISR_DoSomething, RISING);
}
void ISR_DoSomething(){
if (Touch.dataAvailable()) {
Serial.println("Screen Pushed");
}