Maybe check getPinMode(BTN)? It should report input_pulldown.
getPinMode(BTN)
input_pulldown
As @DrAzzy says, if it were just floating then it would cause the kinds of issues you're reporting
@Gordon started
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.
Maybe check
getPinMode(BTN)
? It should reportinput_pulldown
.As @DrAzzy says, if it were just floating then it would cause the kinds of issues you're reporting