/* Created by Ivan Sanchez Modified by Megumi Iwata on 19.03.2018 Modified by Michael O on 19.03.2019 */ const int buttonPin = 7; // changed this from 3 to 7 const int ledPin = 8; void setup() { // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT); } void loop() { // read the state of the pushbutton value: int button = digitalRead(buttonPin); // check if the pushbutton is pressed. if (button == LOW){ digitalWrite(ledPin, HIGH); delay(100); digitalWrite(ledPin, LOW); delay(100); digitalWrite(ledPin, HIGH); delay(100); digitalWrite(ledPin, LOW); delay(100); digitalWrite(ledPin, HIGH); delay(100); } else { digitalWrite(ledPin, LOW); } }