Button is never LOW on ESP8266

I didn't fully re-write the sketch, I just changed it up so that the pb might work (with INPUT_PULLUP).
I don't know how the functionality is supposed to flow.

While the @beshur simply can't figure out the N/O and N/C contancts of a Button, how can it be expected form him to have known that every input line of the NodeMCU has a built-in pull-up resistor?

Expecting him to know, would be just commenting on it. Expecting him to not know, is publishing an explanation and ready to run sample code.

1 Like

Do you expect it to work ?
Have you tried it ?

Ok, thank you for all your suggestions.

I disconnected ESP from the breadboard and GPIO 0 (5) still gives me HIGH.
I changed the MY_BTN pin to 3 and it is always LOW, despite connecting it to 3.3V.
This happens on two different ESP8266's.

As for INPUT_PULLUP I tried it before and it did not work either.

My suspicions are that there is a problem with the wiring and/or the switch

What happens if you remove the switch from the circuit and short 2 jumper wires together as the switch on/off ?

Have you tried the sketch of Post-16? When you face a problem and difficult to solve, then look for a working example and play with it and then correct/adjust your non-functioning project.

This is a way of learning that can't be so easily neglectd.

1 Like

That's what I did, and I always get HIGH regardless.

I have a problem with this one, since I have a bare ESP8266, not NodeMCU, and I have only two GPIO's accessible.

Looks like it's normal behaviour

another forum link

Tried my sketch with a Wemos D1 mini (reassigned pins to D6 and D7 respectively) and it's fine.