zunoSetWUOptions()

This call instructs Z-Uno to wake up on INT1 going LOW or HIGH or on Key Scanner button press detection. The built-in hardware keypad scanner is able to scan a key matrix of up to 7 rows x 16 columns. When the Keypad Scanner is activated, the 7 row inputs (pins 17-23) must either be connected to the hardware key matrix or kept open. The number of columns can be configured to the range 1-16. The actual pins being used as column outputs are 9 when the column count is set to one, 9 and 10 when the column count is set to two, 9, 10 and 11 when the column count is set to three, etc. Full list of pins available as columns is the following (ordered): 9-16, 8-3, TX0, RX0 Once the Keypad Scanner is enabled, it will scan each column for an amount of time (set it as output and change voltage). If voltage on rows (pins 17-23) will change correspondingly, the button is assumend as pressed. at a certain column detects a key press. Check Z-Uno pinout zunoSetWUOptions(reason) reason ZUNO_WUPFLAGS_INT1_HIGH or ZUNO_WUPFLAGS_INT1_LOW or ZUNO_WUPFLAGS_INT1_KEYSCAN none
#define LED_PIN 13

ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_SLEEPING);

void setup() {
  pinMode(LED_PIN, OUTPUT);      // set LED pin as output
  zunoSetWUOptions(ZUNO_WUPFLAGS_INT1_KEYSCAN); // turn INT1 wakeup into Key Scanner mode
                                 // can also be called in any other place before zunoSendDeviceToSleep()
}

void loop() {
  digitalWrite(LED_PIN, HIGH);   // turn LED on
  delay(1000);                   // wait for 1 second
  digitalWrite(LED_PIN, LOW);    // turn LED off
  delay(1000);                   // wait for 1 second

  zunoSendDeviceToSleep();	     // go to sleep
}