int button = 4; // the number of the pushbutton pin
int led = 5; // the number of the LED pin
void setup() {
Serial.begin(115200);
pinMode(button, INPUT_PULLUP);
pinMode(led, OUTPUT);
}
void loop() {
int pbs = digitalRead(button);
Serial.println(pbs);
if (pbs == HIGH)
{
digitalWrite(led, 0);
}
else
{
digitalWrite(led, 1);
}
}