NodeMCU Projects: Difference between revisions
→DHT11 Temp Sensor
Line 93:
== DHT11 Temp Sensor ==
*Use DHT11 Module driectly, Do not use Sensor board with Pull Up resistor.
*Testing Sensor:
<syntaxhighlight lang="python">
>>> from machine import Pin
>>> from dht import DHT11
>>> d = DHT11(Pin(14)) # Pin D5
>>> d.measure()
>>> d.temperature()
28
>>> d.humidity()
16
</syntaxhighlight>
*Printing Temperature to I2C LCD
<syntaxhighlight lang="python">
from machine import Pin
from dht import DHT11
d = DHT11(Pin(14)) # Pin D5
d.measure()
d.temperature() d.humidity()
</syntaxhighlight>
== Deep-sleep mode ==
|