Project: Electronics Bash - #16- Hardware Interrupts


Writing interactive code without interrupts can be like waiting for a letter to come - you have to keep checking the mailbox to see if any new info has arrived. Interrupts are like an alarm on your mailbox that draws your attention so you don't need to keep checking. They're powerful, useful, and a little finicky - they'll be our subject this week.

Topics Include:

  • Interrupts
  • ISRs
  • The 'volatile' quantifier
  • Timers

Code Libraries

This week we’ll be making extensive use of the EnableInterrupt Library to to handle Pin Change interrupts. You can download it from the link above.

Code

The following code will make use of the above circuit diagram

Interrupts Basic

Click here to view code on Github

Interrupts Serial

Click here to view code on Github

Interrupts Serial Debounce

Click here to view code on Github

Interrupts Array

Click here to view code on Github

Enable Interrupts - Simple Example

Click here to view code on Github