You are reading a single comment by @MaBe and its replies. Click here to read the full conversation.
  • changes to module DHT22:

    ....
      setTimeout(function() {
    
        pinMode(D5,'output');digitalPulse(D5, 0, 1) // fire a 1ms  marker 
    
        clearWatch(ht.watch);
        delete ht.watch;
    ....
        }
      },6);
    };
    ....
    

    sample DHT22 code:

    E.on("init",function(){
    
      dht = require("DHT22").connect(D4);
    
      setInterval(function(){
        dht.read(function (a) { 
          console.log("t = "+a.temp.toFixed(1).toString()
                      +", rh = "+a.rh.toFixed(1).toString()
                      //+"\nraw:"+a.raw+
                      //+"\nerr:"+a.err+
                      //+", cse:"+a.checksumError
                     );},
          1);
    
      },2000);
    });
    
    save();
    

    output is -1 for both value, changing 6 to 30 I receive correct values.

    plus logic analyzer screen shot "001.jpg" of on dht.read

    Question: why is the marker fired so late ?


    1 Attachment

    • 001.JPG
About

Avatar for MaBe @MaBe started