dht.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:yunba-smarthome 作者: yunbademo 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号