import dht
from machine import Pin
import time
from dht import DHT22
DHT22_PIN = 23
#sensor = dht.DHT22(Pin(23))
sensor = DHT22(Pin(DHT22_PIN, Pin.IN, Pin.PULL_UP))
while True:
sensor.measure()
temp = sensor.temperature()
hum = sensor.humidity()
print("Temperature : ", temp, " Humidity : ", hum)
time.sleep(1)