var counter = 0;
function update() {
var a = new Uint32Array([counter]);
NRF.setAdvertising({},{
name: "ELEC",
connectable : false,
scannable : false,
manufacturer:0x0590,
manufacturerData:a.buffer,
interval: 600 // default is 375 - save a bit of power
});
}
D1.reset();
pinMode(D2,"input_pullup");
setWatch(function(e) {
counter++;
update();
digitalPulse(LED1,1,10); // show activity
}, D2, { repeat:true, edge:"falling" });
update();
It works amazingly well - I'll try and stick a video/tutorial up soon.
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.
I just gave this a go on Puck.js with an LDR between D1 and D2: http://www.espruino.com/LDR
It works amazingly well - I'll try and stick a video/tutorial up soon.