#Control del sensor de temperatura mediante el servo motor
# se llaman los módulos necesarios
from machine import Pin, PWM, ADC
import time
from dht import DHT22
# Función y Objetos
def main():
servo_sg90 = PWM (Pin(26), freq = 50)
sensor_dht = DHT22(Pin(19))
#____________________________________________________
mover = 180
mover2 = 0
while True:
sensor_dht.measure()
temp = float (sensor_dht.temperature())
hum = float (sensor_dht.humidity())
time.sleep(1)
print("Valor de la temperatura", temp, "Valor de la humedad", hum)
if __name__ =='__main__':
main()