ia
const int buttonPin = 2;
const int ledpin = 21;
int buttonState 0;
void setup() {
pinMode(ledPin,OUTPUT);
pinMode(buttonPin, INPUT_PULLUP);
}
void loop()
buttonState = digitalRead(buttonPi);
if (buttonState == HIG) {
digitalWrite(ledPin, LOW);
} else {
digitalWrite(ledPin, HIGH);
}
}