• Yes... but I posted on there twice asking if the webpage that goes with it could be fixed - no reply yet :)

    @allObjects would you mind fiddling with the documentation file?

    For now, it can be used with:

    var SWBtn = require("https://raw.githubusercontent.c­om/muet/EspruinoDocs/master/modules/SWBu­tton.js");
    var mySWBtn = new SWBtn(function(k){
        console.log("BTN1 detected " + k); // log key press pattern
        if        (k === "L"  ) { LED1.set();
        } else if (k === "LS" ) { LED1.reset();
        } else if (k === "LL" ) { LED2.set();
        } else if (k === "LLS") { LED2.reset();
        }
      });
    
  • var SWBtn = require("https://raw.githubusercontent.c­om/muet/EspruinoDocs/master/modules/SWBu­tton.js");
    var mySWBtn = new SWBtn(function(k){
        console.log("BTN1 detected " + k); // log key press pattern
        if        (k === "L"  ) { LED1.set();
        } else if (k === "LS" ) { LED1.reset();
        } else if (k === "LL" ) { LED2.set();
        } else if (k === "LLS") { LED2.reset();
        }
      });
    

    could anyone explain how to change default button pin?

About

Avatar for bigplik @bigplik started