const byte interruptPin = 3;
volatile uint8_t count = 0;
void setup() {
Serial.begin(115200);
pinMode(interruptPin, INPUT);
attachInterrupt(digitalPinToInterrupt(interruptPin), on_button_pressed, RISING);
pinMode(2, INPUT);
attachInterrupt(digitalPinToInterrupt(2), on_button_pressed_2, RISING);
}
void on_button_pressed() {
count++;
}
void on_button_pressed_2() {
count++;
}
void loop() {
Serial.println(count);
}