openmv/scripts/examples/OpenMV/12-Thermopile-Shield/MLX90640_camera.py
2020-12-26 18:53:09 -08:00

24 lines
462 B
Python

# MLX90640 Camera Demo
#
# This example shows off how to overlay a heatmap onto your OpenMV Cam's
# live video output from the main camera.
import image, time, fir
# Initialize the thermal sensor
fir.init(type=fir.FIR_MLX90640, refresh=32) # 16Hz, 32Hz or 64Hz.
# FPS clock
clock = time.clock()
while (True):
clock.tick()
try:
img = fir.snapshot(copy_to_fb=True)
except OSError:
continue
# Print FPS.
print(clock.fps())