const int Btn= 13;
bool stateBtnIni = LOW;
bool stateBtnFin = LOW;
int count = 0;
void setup() {
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(Btn, INPUT_PULLUP);
}
void loop() {
stateBtnIni = digitalRead(Btn);
delay(100);
stateBtnFin = digitalRead(Btn);
if (stateBtnIni == HIGH && stateBtnFin == LOW){
count++;
Serial.println(count);
}
}