Question: how to connect push button to nodemcu?
Answer: Push Button connections : The first pin goes from one leg of the pushbutton through a pull-up resistor(here 10K Ohms) to the 5v supply. The second pin goes from the corresponding leg of the pushbutton to Ground (GND) pin. The third pin connects to a Digital I/O pin (here pin D0) which reads the button's state.