bool btnState = false;
void setup() {
Serial.begin(115200);
pinMode(2, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(2), fonctionBp, CHANGE );
}
void loop() {
unsigned long time;
time = millis();
Serial.println(btnState);
}
void fonctionBp () {
btnState = !btnState;
}