I want to create the sensor switch.
I am using esp8266 and sensor button.
When I touch switch, I want that esp8266 recive signal about it.
I wrote pinMode(5, INPUT); and read data by digitalRead (5); , but ‘pinvalue’ is always empty.
int pinvalue = digitalRead (5);
if (pinvalue==HIGH){
Serial.write(‘yes’);
} else {
Serial.write(‘no’);
}
What I am doing wrong? How to read data from digital pin esp8266? I didn’t find any information and documentation.
Help please if someone faced with that problem…