Ordinarily, human reaction time is slow enough that you can execute many functions within the loop() of an Arduino program, and can poll a button once every time you go through the loop without missing the button press. However, when there are “slow” components to your code within the loop(), you risk missing external inputs. That's where interrupts come in. Select pins on your Arduino (or all pins on the Due) can function as external hardware interrupts. Hardware within the ATMega knows the state of these pins and can report their values to your code asynchronously. Hence, you can execute your main program, and have it “interrupted” to run a special function whenever an external interrupt event is detected. This interrupt can happen any...
- CHAPTER 12: Hardware and Timer Interrupts
- from Exploring Arduino: Tools and Techniques for Engineering Wizardry
- Publisher: John Wiley & Sons
- Released: July 2013
Arduino Hardware Interrupts
Share this highlighthttp://www.safaribooksonline.com/a/exploring-arduino-tools/156/