from machine import Pin
from time import sleep
import dht
red = Pin(16, Pin.OUT)
sensor = dht.DHT22(Pin(18))
#sensor = dht.DHT22(Pin(18))
while True:
red.on()
sleep(1)
red.off()
sleep(1)
sleep(1)
sensor.measure()
temp = sensor.temperature()
humi = sensor.humidity()
print('Temperature: %3.2f C' %temp)
print('Humidity: %3.1f %%' %humi)
print('by Oamphaithip Kham yod')