I directly copy-pasted the dht.md example from the official NodeMCU GitHub into my Script window like so:
But upon saving to ESP8266 I get an error:
init.lua:3: attempt to index global 'dht' (a nil value)
I directly copy-pasted the dht.md example from the official NodeMCU GitHub into my Script window like so:
But upon saving to ESP8266 I get an error:
init.lua:3: attempt to index global 'dht' (a nil value)
Which NodeMcu firmware (version) do you use? Make sure you get (build) the latest (1.5.1), easiest to get it from here: http://nodemcu-build.com/
And -make sure- you click the little box saying 'DHT' there.