NodeMCU Projects: Difference between revisions
→DHT11 Temp Sensor
Line 92:
== DHT11 Temp Sensor ==
Source: [https://github.com/lvidarte/esp8266/wiki/MicroPython:-DHT11 github.com]
*Use DHT11 Module driectly, Do not use Sensor board with Pull Up resistor.
Line 110 ⟶ 112:
<syntaxhighlight lang="python">
import time
from esp8266_i2c_lcd import I2cLcd
d = DHT11(Pin(14)) # Pin D5
▲ from machine import Pin
▲ from dht import DHT11
lcd = I2cLcd(i2c, 63, 2, 16)
while True:
lcd.putstr("Temp is: " + str(d.temperature()) + "'C \nHum is: " + str(d.humidity()) + "%")
time.sleep(10)
lcd.clear()
</syntaxhighlight>
|