var Ruuvitag = require('Ruuvitag');
function onInit() {
Ruuvitag.setEnvOn(true);
setInterval(function() {
console.log(Ruuvitag.getEnvData());
}, 5000);
}
After restarting the ruuvi I get this message:
in function called from system
Uncaught Error: Field or method "getData" does not already exist, and can't create it on undefined
at line 1 col 12
exports.env.getData()
in function "getEnvData" called from line 5 col 33
console.log(Ruuvitag.getEnvData());
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.
Hey everybody,
I tried your example but it doesn't work.
After restarting the ruuvi I get this message:
in function called from system
Uncaught Error: Field or method "getData" does not already exist, and can't create it on undefined
at line 1 col 12
exports.env.getData()
in function "getEnvData" called from line 5 col 33
console.log(Ruuvitag.getEnvData());
What could be the problem?