const int button = 26; // the number of the pushbutton pin
const int ledpin = 25; // the number of the LED pin // D1(gpio5)int button = 4; //D2(gpio4)
int buttonState=0;
void setup() {
pinMode(ledpin, OUTPUT);
pinMode(button, INPUT);
}
void loop() {
buttonState=digitalRead(button); // put your main code here, to run repeatedly:
if (buttonState == 1)
{
digitalWrite (ledpin, HIGH);
delay(200);
}
if (buttonState==0)
{
digitalWrite(ledpin, LOW);
delay(200);
}
}