I guess it's because you're just running the code once, and also you're trying to output a value between 0 and 1 as an integer?
What about:
setInterval(function() { NRF.setAdvertising([ {0x181A : [Puck.light()*100]}], {interval:500} ); }, 500);
The example code on http://www.espruino.com/Reference#l_NRF_setAdvertising shows how you could report the temperature using setInterval as well.
@Gordon 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.
I guess it's because you're just running the code once, and also you're trying to output a value between 0 and 1 as an integer?
What about:
The example code on http://www.espruino.com/Reference#l_NRF_setAdvertising shows how you could report the temperature using setInterval as well.