def get_ht_thread():
global h
global t
while True:
gpio_lock.acquire()
ht = dht.read_retry(dht.DHT22, config.DHT22_GPIO_NUM)
gpio_lock.release()
h = '{0:0.1f}'.format(ht[0])
t = '{0:0.1f}'.format(ht[1])
h = string.atof(h)
t = string.atof(t)
time.sleep(2)
评论列表
文章目录