micropython-examples/dht11/dht11.py

10 lines
165 B
Python

import dht
import machine
d = dht.DHT11(machine.Pin(12))
try:
d.measure()
print(d.temperature())
print(d.humidity())
except Exception as e:
print(e)