int buttonState=0;
void setup() {
// put your setup code here, to run once:
pinMode(2, INPUT);
pinMode(13, OUTPUT);
}
void loop() {
// read the statement of pushbutton value
buttonState=digitalRead(2);
//check if pushbutton is pressed.if it is,then
//buttonState is high
if(buttonState== HIGH){
digitalWrite(13, HIGH);
}
else{
//buttonState is high
digitalWrite(13, LOW);
}
}