void setup() {
\xA0 // initialize the LED pin as an output:
\xA0 pinMode(ledPin, OUTPUT);\xA0\xA0\xA0\xA0\xA0
\xA0 // initialize the pushbutton pin as an
input:
\xA0 pinMode(buttonPin, INPUT);\xA0\xA0\xA0\xA0
}
void loop(){
\xA0 // read the
state of the pushbutton value:
\xA0 buttonState = digitalRead(buttonPin);
\xA0 // check if the
pushbutton is pressed.
\xA0 // if it is, the buttonState is HIGH:
\xA0 if (buttonState == HIGH) {\xA0\xA0\xA0\xA0
\xA0\xA0\xA0 // turn LED on:\xA0\xA0\xA0
\xA0\xA0\xA0 digitalWrite(ledPin, HIGH);\xA0
\xA0 }
\xA0 else {
\xA0\xA0\xA0 // turn LED off:
\xA0\xA0\xA0 digitalWrite(ledPin, LOW);
\xA0 }
}