I have been using an Arduino Mega 2560 and a '2.8" TFT Color LCD,touch screen shield for Arduino Mega' from nuelectronics for a few days now designing the GUI for new machine (in an attempt for cost reduction by replacing my VUnitronics ision230 PLC with an Arduino Mega and a touch TFT display). The machine recieves input from about 10 sensors and controls a brushless DC motor, a stepper motor and 3 solenoids.
My GUI is almost complete but I have a very big concern now. To control the motors, I need to exit the endless while(1) loop which "listens" for touch screen points and checks if the touch point is valid and which menu was pressed. This means that until the machine completes its cycle, I can not accept any input from my touch screen (to stop the cycle for example).
So basically my question is, is there a way to attach an interrupt to the touch screen and only respond to that interrupt instead of being stuck in an endless loop?
I know that it's possible to attach 6 interrupts to the Arduino Mega but none of them are the pins my TFT is using.