const int pinButton=2;
const int pinLed=8;
int statusLed =LOW;
void setup() {
// put your setup code here, to run once:
pinMode(pinButton, INPUT);
pinMode(pinLed, OUTPUT);
digitalWrite(pinButton, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(pinButton)==LOW){
statusLed = !statusLed;
delay(200);
}
digitalWrite(pinLed, statusLed);
}