const int buttonPin = 2;
const int ledPin = 7;
int buttonState = 0;
int count = 1;
void setup() {
pinMode(buttonPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
delay(50);
if (buttonState == HIGH) {
count++;
delay(500);
}
}
if (count >= 4) {
for (int i = 0; i < 4; i++) {
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
delay(500);
}
count = 0;
}
}