Hello, I'm trying to use the Arduino library EnableInterrupt to enable Pin Change Interrupts on an Arduino Mega, which does not work.
Using the same library & code on the Uno works fine. Using the builtin "attachInterrupt" function (which uses External Interrupts) also works, but that only works for a select number of pins of course.
I've used the following code to test this, hooking up a Clock to the specified pin:
Using the same library & code on the Uno works fine. Using the builtin "attachInterrupt" function (which uses External Interrupts) also works, but that only works for a select number of pins of course.
I've used the following code to test this, hooking up a Clock to the specified pin:
- Code:
#include <EnableInterrupt.h>
#define ARDUINOPIN 7
volatile int intCount = 0;
void setup() {
Serial.begin(9600);
enableInterrupt(ARDUINOPIN, interrupt, RISING);
}
void loop() {
Serial.println(intCount);
delay(50);
}
void interrupt() {
intCount++;
}
Last edited by arcachofo on Sat May 14, 2022 5:30 pm; edited 1 time in total (Reason for editing : Mark as unsolved (red color))