from machine import Pin, I2C
from time import sleep
from dht import DHT22
from ssd1306 import SSD1306_I2C
i2c=I2C(0, sda=Pin(0), scl=Pin(1), freq=400000)
oled = SSD1306_I2C(128, 64, i2c)
dht=DHT22(Pin(16))
while True:
dht.measure()
temp=dht.temperature()
hum=dht.humidity()
oled.text(f"Temp: {temp}C ", 0, 0)
oled.text(f"Humidity: {hum}%", 1,10)
oled.show()
sleep(2)