Hi,
could You help my discover, why the state on the btnPin (gpio14 (D5)) does not back to HIGH when I disconnect from GND?
The case is: when this D5 is open (not connect to gnd) I see “1” in blynk in Value Display which is connected to V0, so all is correct. But when I connect this pin to gnd then Value Display shows “0” which is also correct, but when I disconnect then the state is still “0”. Shouldn’t be “1” due to set INPUT_PULLUP which I declared in setup method?
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "_YOD......";
char ssid[] = "...";
char pass[] = ".....";
const int ledPin = 5;
const int btnPin = 14;
BlynkTimer timer;
void setup()
{
Serial.begin(115200);
pinMode(btnPin,INPUT_PULLUP);
Blynk.begin(auth, ssid, pass);
timer.setInterval(1000L, checkBtnState);
}
void checkBtnState(){
Serial.println("GPIO state:");
Serial.println(digitalRead(btnPin));
}
BLYNK_READ(V0){
Blynk.virtualWrite(V0,digitalRead(btnPin));
}
void loop()
{
Blynk.run();
timer.run();
}