Your other problem (which isn't good for Espruino) is that when you press the button, you're applying 5v (from VBat) to 3.3v only pins. See http://www.espruino.com/ReferenceESPRUINOBOARD - the pins that can't take 5v are marked with 3.3.
I'd suggest that instead of connecting the other side of the buttons to VBat, you connect it to 3.3
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.
Hi. I think your problem is that when you run
setWatch
, the pin state is changed to an input. Try manually specifying it by replacing:with:
Your other problem (which isn't good for Espruino) is that when you press the button, you're applying 5v (from VBat) to 3.3v only pins. See http://www.espruino.com/ReferenceESPRUINOBOARD - the pins that can't take 5v are marked with 3.3.
I'd suggest that instead of connecting the other side of the buttons to VBat, you connect it to 3.3
Hope that helps!