Jump to content

NodeMCU Projects: Difference between revisions

Line 93:
== DHT11 Temp Sensor ==
 
*Use DHT11 Module driectly, Do not use Sensor board with Pull Up resistor.
{{UC}}
*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 ==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.