温度数组 = []
while (True):
clock.tick()
img = sensor.snapshot()
ta, ir, to_min, to_max = fir.read_ir()
to_max=to_max/0.92
fir.draw_ir(ir_buffer, ir, alpha=256)
ir_buffer.mean(IR_SCALE-1)
img.draw_image(ir_buffer, 200, 0, alpha=256,color_palette=sensor.PALETTE_IRONBOW)
#img.draw_string(8, 0, "Ta: %0.2f C" % ta, color = (255, 0, 0),scale = 2, mono_space = False)
#img.draw_string(8, 16, "To min: %0.2f C" % to_min, color = (255, 0, 0),scale = 2, mono_space = False)
img.draw_string(200, 96, "Temp: %0.2f C"% to_max, color = (255, 0, 0),scale = 2, mono_space = False)
温度数组.append(ta)
if(len(温度数组) > 100):
平均数 = sum(温度数组)/len(温度数组)
print(平均数)
break
print("跳出循环")