Maybe check getPinMode(BTN)? It should report input_pulldown.
As @DrAzzy says, if it were just floating then it would cause the kinds of issues you're reporting
© Espruino, powered by microcosm.
Report a problem