uint16_t count = 0;
void setup() {
Serial.begin(115200);
// put your setup code here, to run once:
pinMode(9, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(9)) {
while (digitalRead(9)) {}
count ++;
Serial.println(count);
}
}