Yo, my knowledge of the whole interrupt thing is very limited. I read through datasheet about the available timing interrupts, but I'm curious, how does one make an interrupt for the Touch Screen. As of now, I poll each loop to see if touch data is available then make decisions if it is. This, to me, seems inefficient and I feel as though I should use an interrupt. But I'm also concerned as to what that means. When the code is doing its main task, the interrupt may cause a loss in data? Help, thoughts, musings, insults?
This, to me, seems inefficient and I feel as though I should use an interrupt.
You don't just "use an interrupt" because you feel like it. You write an interrupt service routine because the timer/device/library generates an interrupt, and you want to handle the interrupt.
It is unlikely that the touch screen generates an interrupt on being touched.
When the code is doing its main task, the interrupt may cause a loss in data?
The arrival of serial data generates an interrupt. The clock ticking generates an interrupt. Neither of these cause a loss of your data, do they?
insults?
You're ugly and your momma dresses you funny. 8)
You don't just "use an interrupt" because you feel like it.
This I know. I was basically asking, is it possible to write an interrupt routine that is triggered due to data available from the touchscreen.
The arrival of serial data generates an interrupt. The clock ticking generates an interrupt. Neither of these cause a loss of your data, do they?
When monitoring something in RT, an interrupt would cause said item to no longer be monitored for some small out of time, thus losing data, yes/no?
You're ugly and your momma dresses you funny.
Jokes on you, these items are true.
is it possible to write an interrupt routine that is triggered due to data available from the touchscreen.
The touchscreen (or library) would have to generate the interrupt. If such an interrupt were generated, you could write an interrupt service routine to service the interrupt.
It seems unlikely to me that the touch screen generates such an interrupt, and the library would basically have to be using a timer to determine when the poll the touchscreen, making it even less efficient than simply polling the touch screen in loop().
When monitoring something in RT, an interrupt would cause said item to no longer be monitored for some small out of time, thus losing data, yes/no?
I guess that depends on what you mean by monitoring. If you are reading the state of a pin, on every pass through loop() (what I think of as monitoring), the arrival of serial data, or the ticking of the clock, does not cause you to miss a pin state change, because the interrupt service routines are very, very fast.
Jokes on you, these items are true.
JHawk88:
As of now, I poll each loop to see if touch data is available then make decisions if it is. This, to me, seems inefficient and I feel as though I should use an interrupt.
There is nothing inefficient about polling to see if data is available. Human actions are very slow by Arduino standards and are easily detected by polling.
Interrupts are only essential if things happen too quickly for polling or if the event to be detected on exists for a few microseconds.
...R