from machine import Pin, I2C
from time import sleep
import dht
medicion = dht.DHT22(Pin(5))
from ssd1306 import SSD1306_I2C
ancho = 128
alto = 64
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
oled = SSD1306_I2C(ancho, alto, i2c)
print(i2c.scan())
while 1:
oled.fill(0)
medicion.measure()
tem = medicion.temperature()
hum = medicion.humidity()
oled.text("Humedad- ", 0, 0)
oled.text(str(hum), 90, 0)
oled.text("Temper- ", 0, 20)
oled.text(str(tem), 90, 20)
oled.show()
sleep(1)
Loading
esp32-devkit-c-v4
esp32-devkit-c-v4
Loading
ssd1306
ssd1306