Datasheet
mlx.refresh_rate = adafruit_mlx90640.RefreshRate.REFRESH_4_HZ
frame = [0] * 768
while True:
stamp = time.monotonic()
try:
mlx.getFrame(frame)
except ValueError:
# these happen, no biggie - retry
continue
# print("Time for data aquisition: %0.2f s" % (time.monotonic()-stamp))
mini = frame[0] # Define a min temperature of current image
maxi = frame[0] # Define a max temperature of current image
for h in range(24):
for w in range(32):
t = frame[h*32 + w]
if t > maxi:
maxi = t
if t < mini:
mini = t
image_bitmap[w, (23-h)] = int(map_range(t, min_t, max_t, 0, last_color ))
min_label.text="%0.2f" % (min_t)
max_string="%0.2f" % (max_t)
max_label.x=120-(5*len(max_string)) # Tricky calculation to left align
max_label.text=max_string
min_t = mini # Automatically change the color scale
max_t = maxi
# print((mini, maxi)) # Use this line to display min and max graph in Mu
# print("Total time for aquisition and display %0.2f s" % (time.monotonic()-stamp))
Now point the thermal camera at various objects to see a heat map displayed on your board!
© Adafruit Industries https://learn.adafruit.com/adafruit-mlx90640-ir-thermal-camera Page 26 of 30










