// led sample for Puck.js
var LED = [LED1,LED2,LED3]; // array of leds
var BTN = BTN1; // name of button
var i = 0;
var count = LED.length;
setWatch(function (e) {
if (e.state) {
LED[i%count].set();
} else {
LED[i%count].reset();
i++;
}},
BTN,
{ repeat:true, edge:'both',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.