Hi all
In case I want to initiate an interrupt with a switch press down an by this eliminating the need for polling
the switch , do I need denouncing of that switch ?
The switch is connected to a INPUT port .
Also can i use some timer that will periodically make arduino poll the switch ?
The point is avoiding the switch slowing down the code execution by polling the switch .
elico:
The point is avoiding the switch slowing down the code execution by polling the switch .
That is probably not a problem, and using interrupts as you're proposing is probably not going to fix it even if it had been a problem. All you're doing IMO by using interrupts is introducing extra complexity. Use interrupts only as a last resort when absolutely necessary - it's pretty unlikely you actually need them just to detect user input via a switch.
All you're doing IMO by using interrupts is introducing extra complexity.
I fully agree with this. You remove the need to poll the switch, but the ISR can do no more than set a flag that you have to poll anyway. So, net advantage == 0, with plenty of disadvantages introduced.