But result Temp is -1 and RH is -1
echo(1); // Init ESP8266 var ESP8266 = require("ESP8266"); ESP8266.setLog(2); ESP8266.printLog(); E.setClock(80); var dht = require("DHT11").connect(D14); //GPIO14 NodeMCU is pin D5 //setWatch(function(e){ // console.log(e.time - e.lastTime); //}, D14, {repeat: true, edge:"both"}); var dht2 = function(){ dht.read( function(a){ console.log("Temp is "+a.temp.toString()+" and RH is "+a.rh.toString()); }); return true; }; dht2();
@Aleksandrs 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.
But result Temp is -1 and RH is -1