dht22 raspberry pi zero connector

Solutions on MaxInterview for dht22 raspberry pi zero connector by the best coders in the world

showing results for - "dht22 raspberry pi zero connector"
Brian
06 Jun 2020
1import Adafruit_DHT
2
3DHT_SENSOR = Adafruit_DHT.DHT22
4DHT_PIN = 4
5
6while True:
7    humidity, temperature = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)
8
9    if humidity is not None and temperature is not None:
10        print("Temp={0:0.1f}*C  Humidity={1:0.1f}%".format(temperature, humidity))
11    else:
12        print("Failed to retrieve data from humidity sensor")
similar questions
micropython xbee 3 dht22