const int ledPin = 7; // the number of the LED pin const int buttonPin = 3; // the number of the pushbutton pin void setup() { pinMode(7, OUTPUT); // initialize the LED pin as an output pinMode(3, INPUT); // initialize the pushbutton pin as an input } void loop() { if(digitalRead(3)){ // read the state of the pushbutton value digitalWrite(7,LOW); } else{ digitalWrite(7,HIGH); } }