import dht
from machine import Pin
from utime import sleep
sensor = dht.DHT22 (Pin(22))
while True:
sleep(2)
sensor.measure() # 복잡한 처리과정을 단순화해주는 method? module 하여튼 간단하게 해줌
temp = sensor.temperature()
hum = sensor.humidity()
temp_f = temp * (9/5) + 32.0
print("Temperature: %3.1f C" %temp)
print("Temperature: %3.1f F" %temp_f)
print("Humidity: %3.1f %%" %hum)