// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(8, OUTPUT); } // the loop function runs over and over again forever void loop() { int x = digitalRead(7); // read button state, if LOW it is being pressed if (x == LOW) { digitalWrite(8, HIGH); }// turn the LED on (HIGH is the voltage level) else { digitalWrite(8, LOW); // turn the LED off (LOW is the voltage level) } }