#define PinButton 2
#define ledPin 12
void setup() {
pinMode(PinButton, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
}
void loop() {
if (digitalRead(PinButton) == LOW){
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
delay(100);
}