Many thanks once again @Robin
Your comment helped me to gain a huge insight and I think as you mentioned, and also as per the circuit diagram shared by @MaBe I should use a pull up resistor and Im sure it will definitely resolve the issue.
Really appreciate for the assistance to resolve this case.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Many thanks once again @Robin
Your comment helped me to gain a huge insight and I think as you mentioned, and also as per the circuit diagram shared by @MaBe I should use a pull up resistor and Im sure it will definitely resolve the issue.
Really appreciate for the assistance to resolve this case.
Thanks @MaBe too for the diagram!
Cheers