Thanks! And yes, good plan - I'll make a tutorials section.
Cunningly the Espruino documentation (https://github.com/espruino/EspruinoDocs) and the forum use the same markdown syntax so you can just copy and paste your post (via 'Edit') into a new tutorial. Kim: are you ok with this? I'd be very happy to add your post.
Just some stuff that might be helpful:
Your ERROR: Unknown Timeout error could be solved by adding timeout_ID=undefined to the Timeout call itself, and then if (timeout_ID!==undefined) clearTimeout(...)
setWatch can be called like setWatch(swap_on_down, BTN1, {repeat:true,edge:"rising"}); so that it only calls your swap_on_down function when the button becomes pressed.
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.
Thanks! And yes, good plan - I'll make a tutorials section.
Cunningly the Espruino documentation (https://github.com/espruino/EspruinoDocs) and the forum use the same markdown syntax so you can just copy and paste your post (via 'Edit') into a new tutorial. Kim: are you ok with this? I'd be very happy to add your post.
Just some stuff that might be helpful:
Your ERROR: Unknown Timeout error could be solved by adding
timeout_ID=undefined
to the Timeout call itself, and thenif (timeout_ID!==undefined) clearTimeout(...)
setWatch
can be called likesetWatch(swap_on_down, BTN1, {repeat:true,edge:"rising"});
so that it only calls your swap_on_down function when the button becomes pressed.