const int ledPin = D0; // the number of the LED pin0 const int ledPin2 = D6; // the number of the LED pin6 const int ledPin3 = D7; // the number of the LED pin7 const int buttonPin = D1; // the number of the pushbutton pin int buttonState = 0; // variable for reading the pushbutton status void setup() { Serial.begin(9600); pinMode(buttonPin, INPUT); pinMode(ledPin, OUTPUT); pinMode(ledPin2, OUTPUT); pinMode(ledPin3, OUTPUT); } void loop() { buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { for (int i=0; i <= 5; i++) { delay(500); digitalWrite(ledPin, HIGH); delay(500); digitalWrite(ledPin, LOW); delay(500); digitalWrite(ledPin2, HIGH); delay(500); digitalWrite(ledPin2, LOW); delay(500); digitalWrite(ledPin3, HIGH); delay(500); digitalWrite(ledPin3, LOW); } } else { digitalWrite(ledPin, LOW); } }