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
@MaBe 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.
changes to module DHT22:
sample DHT22 code:
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