main.py 文件源码

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

项目:CoPilot-InfotainmentSystem 作者: Joelzeller 项目源码 文件源码
def read_temp():
    global temp_f
    lines = read_temp_raw()
    while lines[0].strip()[-3:] != 'YES':
        #time.sleep(0.2)
        lines = read_temp_raw()
    equals_pos = lines[1].find('t=')
    if equals_pos != -1:
        temp_string = lines[1][equals_pos+2:]
        temp_c_raw = float(temp_string) / 1000.0
        temp_f_raw = temp_c_raw * 9.0 / 5.0 + 32.0
        temp_f = "{0:.0f}".format(temp_f_raw) #only whole numbers


#_________________________________________________________________
        #VARIABLES
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号