and the code
NRF.on('connect', function(addr) { digitalWrite(LED3,1); setTimeout(function () { digitalWrite(LED3,0); }, 750); }); NRF.on('disconnect', function(addr) { digitalWrite(LED1,1); setTimeout(function () { digitalWrite(LED1,0); }, 750); } ); NRF.setServices({ 0x1809 : { // Temp 0x2A6E: { // Temperature readable: true, value : [E.getTemperature().toFixed(2)] }}, 0x180F : { // Battery Service 0x2A19: { // Battery Level readable: true, value : [Puck.getBatteryPercentage().toFixed(0)] } } });
@Adam79 started
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.
and the code