LowPowerLab Forum

Hardware support => Moteino M0 => Topic started by: andymcl on October 23, 2019, 01:21:23 AM

Title: External Interrupt pin remains high
Post by: andymcl on October 23, 2019, 01:21:23 AM
I'm a total novice with interrupts so I would value some assistance.
If create an ISR as per below
attachInterrupt(digitalPinToInterrupt(5), EXT_int1, HIGH)
and the pin remains high for an extended period (mins/hours/days) does the ISR execute repeatedly?
Title: Re: External Interrupt pin remains high
Post by: Felix on October 23, 2019, 08:48:16 AM
Use it like this, example for D0:

#define INTERRUPT_PIN 0 /*D0*/

void setup() {
  pinMode(INTERRUPT_PIN, INPUT); /*pin 0 active high*/
/*or:   pinMode(INTERRUPT_PIN, INPUT_PULLUP); using internal pullup, makes pin 0 active low*/
}

attachInterrupt(ACTUAL_DIGITAL_PIN_NUMBER, wakeupISR, HIGH);
/*or attachInterrupt(ACTUAL_DIGITAL_PIN_NUMBER, wakeupISR, LOW); //for active low (pin declared INPUT_PULLUP or pulled up high via resistor) */

void wakeupISR(void) { /*ISR code, if any*/ }