const int buttonPin = 10;//the number of the pushbutton pin const int ledPinred = 6;// the number of the redLED pin int ledState = LOW; int buttonState = 0; void setup() { pinMode(ledPinred, OUTPUT); pinMode(buttonPin, INPUT); } void loop() { buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { digitalWrite(ledPinred, HIGH); // turn the LED on (HIGH is the voltage level) delay(2000); } else { digitalWrite(ledPinred, LOW); // turn the LED off by making the voltage LOW } }