volatile bool _interrupt = false;
const int buttonPin = 2; // Pin for the button
volatile bool lastButtonState = HIGH; // Previous state of the button
volatile unsigned long lastDebounceTime = 0; // Last time the button state changed
const unsigned long debounceDelay = 50; // Debounce time (milliseconds)
void setup() {
Serial.begin(115200);
Serial.println("test_begin");
pinMode(2, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(2), _ISR, FALLING);
}
void loop() {
Serial.println(_interrupt);
}
void _ISR(){
_interrupt = true;
}