int ledPin = 2;
int butPin = 3;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
pinMode(butPin, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(butPin)){
digitalWrite(ledPin, LOW);
}
else {
digitalWrite(ledPin, HIGH);
}
}