So it seems scoping of setWatch affects readings. I'm not familiar with watch, but it seems to be a "special" citizen, defying normal expectations and capable of crashing everything after repeated use.
This works for some time before it fails with MEMORY.
var dht = require("https://raw.githubusercontent.com/tedd/Espruino_DHT11/master/DHT11_test.js").connect(D27);
function readSensor() {
dht.read(
function (a) {
console.log(a);
setTimeout(readSensor, 5000);
});
}
readSensor();
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.
So it seems scoping of setWatch affects readings. I'm not familiar with watch, but it seems to be a "special" citizen, defying normal expectations and capable of crashing everything after repeated use.
This works for some time before it fails with MEMORY.