int x = 0;
bool stav = HIGH;
void setup()
{
pinMode(A0, INPUT_PULLUP);
Serial.begin(9600);
}
void loop()
{
bool novyStav = digitalRead(A0);
if(stav == HIGH && novyStav == LOW)
{
x = x + 1;
Serial.println(x);
}
stav = novyStav;
delay(130);
}