legacy/EDGE_CODE/dht_22.py

9 lines
230 B
Python

import Adafruit_DHT
class dht22:
def __init__(self):
self.dht_sensor = Adafruit_DHT.DHT22
self.dht_pin = 4
def get_humidity_temperature(self):
return Adafruit_DHT.read_retry(self.dht_sensor, self.dht_pin)