zunoExtIntMode()

External Interrupts pins are INT0 (pin 17), INT1 (pin 18) and ZEROX (pin 3). Z-Uno can execute a user defined code on an action on those pins. zunoExtIntMode() function allows to configure interrupt trigger event. Interrupts are may faster than polling and uses hardware features to operate. Interrupt handler functions should be defined accordingly. See interrupts description for more information. See restrictions on the code in user handlers in interrupts description. zunoExtIntMode(int_num, mode) int_num the name of the interrupt:
  • ZUNO_EXT_INT0 — INT0 pin
  • ZUNO_EXT_INT1 — INT1 pin
  • ZUNO_EXT_ZEROX — ZEROX pin
mode trigger event:
  • CHANGE — value change
  • FALLING — high to low falling
  • RISING — low to high rising
ZUNO_SETUP_ISR_INT0(int0_handler);

unsigned long count_int0 = 0;

void int0_handler() {
    count_int0++;
}

void setup() {
    zunoExtIntMode(ZUNO_EXT_INT0, FALLING);

    Serial.begin(115200);
}

void loop() {
    Serial.println(count_int0);
    delay(1000);
}

ZEROX pin takes about 20 μs to trigger, while INT0/INT1 take about 40 μs.