Code: Select all
//in setup:
pinMode(16, INPUT_PULLUP);
// in update:
int but1 = digitalRead(16);
if(but1 == HIGH){ }else{
Serial.print("BUTTON Low");
}
one pin is connected to ground and the other to GPIO 16 on the esp8266
Code: Select all
//in setup:
pinMode(16, INPUT_PULLUP);
// in update:
int but1 = digitalRead(16);
if(but1 == HIGH){ }else{
Serial.print("BUTTON Low");
}
Users browsing this forum: No registered users and 10 guests