import machine
from machine import Pin
from utime import sleep
import time
import dht
# Initialize the DHT22 sensor on pin D15
dht22 = dht.DHT22(Pin(15))
print("Hello, ESP32!")
led = Pin(2, Pin.OUT)
print("A dormir")
machine.lightsleep(15000)
while True:
dht22.measure()
print("Temperature: %f C" % dht22.temperature())
print("Humidity: %f %%" % dht22.humidity())
led.on()
time.sleep(1)
led.off()
time.sleep(1)