Hi,
It's because the sensors on the Ruuvitag need to be initialised at power on - and basically your code is initialising them once (at upload).
If you do:
var Ruuvitag = require('ruuvitag'); function onInit() { Ruuvitag.setEnvOn(true); setInterval(function() { console.log(Ruuvitag.getEnvData()); }, 5000); }
Then the onInit function gets called at startup, and initialises the Ruuvitag's sensor then.
onInit
(also, just moved this to the 'other boards' section)
@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.
Hi,
It's because the sensors on the Ruuvitag need to be initialised at power on - and basically your code is initialising them once (at upload).
If you do:
Then the
onInit
function gets called at startup, and initialises the Ruuvitag's sensor then.(also, just moved this to the 'other boards' section)