@Manxome in a similar way you can attach an Interrupt to a pin on, say, an Arduino, you can set a watch on a pin in Espruino. When the pin changes (rises, falls, or both) it will call your function:
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.
@Manxome in a similar way you can attach an Interrupt to a pin on, say, an Arduino, you can set a watch on a pin in Espruino. When the pin changes (rises, falls, or both) it will call your function:
http://www.espruino.com/Reference#l__global_setWatch