// constants won't change. They're used here to set pin numbers: const int buttonPin = 27; // the number of the pushbutton pin const int ledPin1 = 26; // the number of the LED pin const int ledPin2 = 0; const int ledPin3 = 1; // variables will change: int buttonState = 0; // variable for reading the pushbutton status void setup() { pinMode(ledPin1, OUTPUT); // initialize the LED pin as an output: pinMode(ledPin2, OUTPUT); pinMode(ledPin3, OUTPUT); pinMode(buttonPin, INPUT); // initialize the pushbutton pin as an input: } void loop() { buttonState = digitalRead(buttonPin); // read the state of the pushbutton value: if (buttonState == HIGH) { // check if the pushbutton is pressed. If it is, the buttonState is HIGH: digitalWrite(ledPin1, HIGH); // turn LED on: delay(1000); digitalWrite(ledPin2, HIGH); delay(1000); digitalWrite(ledPin3, HIGH); delay(1000); } else { digitalWrite(ledPin1, LOW); // turn LED off: digitalWrite(ledPin2, LOW); digitalWrite(ledPin3, LOW); } }