The button connects (if pressed) VCC (3.3V) to Ground producing a short.
If you want to pull a pin to ground you should always use a resistor e.g. 10k and not tie it directly,
see: https://en.wikipedia.org/wiki/Pull-up_resistor for details.
Note: The article describes pull-up, but the same principle applies to pull down.
© Espruino, powered by microcosm.
Report a problem