Hi! It's basically impossible for you to press both buttons at exactly the same time, so instead you just need to shift thinking a bit - call the same function when either button is pressed, then check the state of both in that function:
function check() {
var a = BTN1.read();
var b = BTN2.read();
if (a&&b) console.log("Both pressed!");
}
setWatch(check, BTN1, {repeat:true, edge:"rising", debounce:20});
setWatch(check, BTN2, {repeat:true, edge:"rising", debounce:20});
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! It's basically impossible for you to press both buttons at exactly the same time, so instead you just need to shift thinking a bit - call the same function when either button is pressed, then check the state of both in that function: