@allObjects - wow - this is very helpful and can be used as button extension for Puck.js
I use it like this
/*
S : single short touch to switch on
SS : double short touch to switch off
*/
var SWBtn =require("https://raw.githubusercontent.com/muet/EspruinoDocs/master/modules/SWButton.js");
var mySWBtn = new SWBtn(function(k){
console.log("BTN1 detected " + k); // log key press pattern
if (k === "S" )
LED3.set();
else if (k === "SS" )
LED3.reset();
});
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.
@allObjects - wow - this is very helpful and can be used as button extension for Puck.js
I use it like this
Thanks for sharing !