# from machine import Pin
# from time import sleep
# from dht import DHT22
# sensor = DHT22(Pin(26))
# while True:
# sensor.measure()
# temp = sensor.temperature()
# humidity = sensor.humidity()
# print('Temperature: %2.2f C' %temp)
# print('Humidity: %2.2f %%' %humidity)
# sleep(1)
from machine import Pin, I2C
from utime import sleep
import dht
from lcd1602 import LCD1602
sensor = dht.DHT22(Pin(22))
i2c = I2C(1, sda=Pin(18), scl=Pin(19))
LCD = LCD1602(i2c)
while True:
sleep(2)
sensor.measure()
temp = sensor.temperature()
hum = sensor.humidity()
LCD.puts('Temperature: ' + str(temp) + ' C' + 'Humidity: ' + str(hum) + ' %')