int buttonState = 0; // variable for reading the pushbutton status
int pb_count = 2;
void setup() {
pinMode(3, OUTPUT);
pinMode(2, INPUT);
Serial.begin (9600);
}
void loop()
buttonState = digitalRead(2);
if (buttonState==1)
{ pb_count = pb_count + 1;
Serial.println (pb_count);
}
if (pb_count%2==1) {
digitalWrite(3, HIGH);
} else {
digitalWrite(3, LOW);
}
delay(250);
}