You are reading a single comment by @th and its replies. Click here to read the full conversation.
  • 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.c­om/tedd/Espruino_DHT11/master/DHT11_test­.js").connect(D27);
    
    function readSensor() {
      dht.read(
        function (a) {
        console.log(a);
        setTimeout(readSensor, 5000);
      });
    }
    
    readSensor();
    
About

Avatar for th @th started