from machine import Pin
from time import sleep
import dht
sensor = dht.DHT22(Pin(14))
while True:
#try:
sleep(2)
sensor.measure()
temp = sensor.temperature()
hum = sensor.humidity()
temp_f = temp * (9/5) + 32
print(f'Temperature:{temp_f}')
print('Temperature:{} c'.format(temp))
print('Humidty:%1f %%'%hum)
# except:
# print('Failed to read sensor')