Jump to content

NodeMCU Projects: Difference between revisions

Line 116:
from dht import DHT11
from esp8266_i2c_lcd import I2cLcd
 
time.sleep(101)
 
d = DHT11(Pin(14)) # Pin D5
Line 123 ⟶ 125:
 
while True:
try:
d.measure()
lcd.putstr("Temperature: " + str(d.temperature()) + "C")
lcd.putstr print("Humiditytemp: ", d.temperature(), "humidity: ", + str(d.humidity()) + "%")
lcd.putstr("Temperature: " + str(d.temperature()) + "C")
time.sleep(10)
lcd.putstr("Humidity: " + str(d.humidity()) + "%")
lcd.clear()
time.sleep(10)
lcd.clear()
except OSError:
print("Sensor read error!!")
lcd.putstr("Sensor read error!!")
time.sleep(5)
lcd.clear()
</syntaxhighlight>
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.