import time
from machine import Pin
import utime as time
from dht import DHT22
from lcd import LCD
dataPin = 22
lcd = LCD()
myPin = Pin(dataPin , Pin.OUT ,Pin.PULL_DOWN)
sensor = DHT22(myPin)
while True:
sensor.measure()
tempC = sensor.temperature()
tempF=tempC*9/5+32
tempCPrint=str(tempC)
tempFPrint= str(tempF)
hum = sensor.humidity()
humPrint = str(hum)
print(hum,tempC)
#print("\r" ,tempPrint+chr(176)+'C' ,humPrint+'%',end='')
lcd.write(0,0,"Temp="+ tempCPrint+'C,'+tempFPrint+'F')
lcd.write(0,1,"Humidity = " + humPrint+'%')
time.sleep(1)