New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
digitalRead on NodeMCU user switch #123
Comments
Hi |
Ok, @GerryKeely pointed me on the right way, I investigated on nodemcu source, key switch is mulplipexed with onboard led, this is really well done, just one pin for switch and LED. The trick is to do things as follow (set gpio16 to input to read then go back pin to output)
following my original sketch is now
works like a charm |
Today I learned: NodeMCU has a way to tie GPIO16 and nRST together. (You need this to get out of ESP.deepSleep.) Just need to add that non-populated resistor R3! |
@linagee |
If you populate it, you should not really be using GPIO16 for anything else unless you want it to reboot every time. |
Thanks, looking at the schematics, makes sense, except if I want to do a soft reset or use the user switch as real reset :-) |
Hi there,
I've got a NodeMCU board with a flash switch and a user switch. The user switch is set as follow
R3 is not populated and here the full schematic
My sketch is as follow
As soon I launch it, GPIO16 is displayed as 1 on serial then I push the user switch, then GPIO16 is displayed as 0, and then GPIO16 never get back to 1 when I release the switch. Is there something I missed or it is related to internal hardware (I could not find a descent datasheet) ? Of course I also tried with
INPUT_PULLUP
with same resultsThank you for your help
The text was updated successfully, but these errors were encountered: