Sunday, April 2, 2017

Arduino Interrupt on Button Press

Hardware: Adafruit Feather 32u4 Radio (RFM69HCW)

Software: Arduino IDE 1.8.1.0 / Windows 10

I can't properly describe how I feel about the documentation on "interrupts" on Arduino.  Even if you don't get into "pin change interrupts" (i.e. NOT THE SAME THING!!!)  it still isn't straightforward.  Add in the fact that the reason you might be looking to handle an external interrupt is because you probably want to put the unit to sleep and now the levels of complexity are notably higher.

I have implemented a fairly simple solution to get past the issues commonly encountered and included it below.  This all revolves around a board going to sleep indefinitely and then waking up on a button press.