void setup() {
pinMode(8,OUTPUT); //Pin 8 will send electricity out (powering the LED)
pinMode(9,INPUT); //Pin 9 will respond to electricity coming in (signals from the button)
}
void loop() {
digitalWrite(8,LOW); //If nothing is happening, turn the LED pin off.
while (digitalRead(9) == HIGH) { //Check to see if the button is pressed
digitalWrite(8,HIGH); //While the button is pressed, turn the LED pin on.
}
}