const int pb = 11;
const int led = 13;
void setup() {
pinMode(pb, INPUT);
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop() {
int count = 0;
Serial.println(count);
while (count > 2){
int lastState = LOW;
if(lastState == LOW && pb == HIGH ){
lastState = 1;
count++;
Serial.println(count);
}
if(lastState == HIGH && pb == LOW ){
lastState = LOW;
}
}
Serial.println ("Exit while loop");
digitalWrite(led, HIGH);
}