I searched around for examples and info on interrupts and the various libraries that exist.
Understanding that the Nano only has 2 hardware interrupts pin 2 & 3, can I sleep a Nano and use a library like PCchangeInt to wait for a change to trigger it to wake up ?
My current set-up has pins 2 & 3 occupied by an Xbee radio so they are not available.
I also have 3 buttons that I need to monitor for change - a button press on any one should wake up the Nano and also wake up the radio. So far the radio wake-sleep part seems a LOT simpler than the Nano part.
It seemed like that - but that still only gives me 2 interrupts for 3 buttons I need to "watch",
or is there a way to configure an interrupt to watch all 3 buttons - in my case the routine would be the same.... wake the Nano, wake the Xbee - send the button press info over the radio.
The info sent would be a single character : 'L', 'Z', 'B' or 'O'.
My other thought was to use buttons with double throw and connect one side "as normal" to the digital pin I monitor in the loop to send the character over the Xbee radio and the other side of each button to the same interrupt pin - could that work ? I don't have those types of push buttons handy so I can't test.
I assume that you are sleeping the Arduino, too. If not, there is not need to use interrupts at all.
The three switches would generate an interrupt to wake the Arduino. In the ISR, you don't have to do anything. In loop(), wake the XBee, determine which switch was pressed, send the message, put the XBee hack to sleep, and go back to sleep.