KRITSADA icon

DHT22 microPython on ESP8266

KRITSADA | PRO | 05/29/19 03:08:29 AM UTC | 0 ⭐ | 712 👁️ | Never ⏰ | []
Python |

200 B

|

None

|

0 👍

/

0 👎

import dht
from time import sleep
import machine
d = dht.DHT22(machine.Pin(14))
 
while True:
  d.measure()
  print('T={} H={}'.format(d.temperature(),d.humidity())) # eg. 23.6 (°C)
  sleep(2)

Comments