const int buttonPin = 4; int buttonState = 0; void setup() { pinMode(3, OUTPUT); pinMode(buttonPin, INPUT); // put your setup code here, to run once: } void loop() { buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { //turn LED on: digitalWrite(3, HIGH); //turn the LED on HIGH is the voltage delay(100); digitalWrite(3, LOW); delay(100); } else { //turn LED off digitalWrite(3, HIGH); //turn the LED on HIGH is the voltage delay(1000); digitalWrite(3, LOW); delay(1000); } }