// Inspiration from the "Simple.ino" example from
// the EnableInterrupt library.
#include <EnableInterrupt.h>
const int buttonPin = 7;
volatile unsigned long interruptCount;
void interruptFunction()
{
interruptCount++;
}
void setup()
{
Serial.begin(115200);
Serial.println("Does the button really bounce ?");
pinMode(buttonPin, INPUT_PULLUP);
enableInterrupt(buttonPin, interruptFunction, CHANGE);
}
void loop()
{
Serial.print("Pin was interrupted: ");
Serial.print(interruptCount, DEC);
Serial.println(" times so far.");
delay(1000);
}
Yes, the button really bounces