Advertisement
KRITSADA

DHT22 microPython on ESP8266

May 28th, 2019
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. import dht
  2. from time import sleep
  3. import machine
  4. d = dht.DHT22(machine.Pin(14))
  5.  
  6. while True:
  7.   d.measure()
  8.   print('T={} H={}'.format(d.temperature(),d.humidity())) # eg. 23.6 (°C)
  9.   sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement