from machine import Pin,SoftI2C
from ssd1306 import SSD1306_I2C
import dht,time
dht22 = dht.DHT22(Pin(15))
i2c=SoftI2C(sda=Pin(14),scl=Pin(12))
oled=SSD1306_I2C(128,64,i2c,addr=0x3c)
while True:
dht22.measure()
oled.fill(0)
oled.text("T:"+str(dht22.temperature())+" C",5,10)
oled.text("H:"+str(dht22.humidity())+" %",5,20)
oled.show()
time.sleep(1)