# Thermal Camera Demo
#
# This example shows how to use common low-res FIR sensors (like MLX or AMG).
# NOTE: Only the AMG8833 is currently enabled for NANO RP2040.

import image, time, fir

IMAGE_SCALE = 5   # Higher scaling uses more memory.
drawing_hint = image.BICUBIC # or image.BILINEAR or 0 (nearest neighbor)

# Initialize the thermal sensor
fir.init()  #Auto-detects the connected sensor.
w = fir.width()  * IMAGE_SCALE
h = fir.height() * IMAGE_SCALE

# FPS clock
clock = time.clock()

while (True):
    clock.tick()

    try:
        img = fir.snapshot(x_size=w, y_size=h,
                           color_palette=fir.PALETTE_IRONBOW, hint=drawing_hint,
                           copy_to_fb=True)
    except OSError:
        continue

    # Print FPS.
    print(clock.fps())

# Thermal Camera Demo
#
# This example shows how to use common low-res FIR sensors (like MLX or AMG).
# NOTE: Only the AMG8833 is currently enabled for NANO RP2040.

import image, time, fir

IMAGE_SCALE = 5   # Higher scaling uses more memory.
drawing_hint = image.BICUBIC # or image.BILINEAR or 0 (nearest neighbor)

# Initialize the thermal sensor
fir.init()  #Auto-detects the connected sensor.
w = fir.width()  * IMAGE_SCALE
h = fir.height() * IMAGE_SCALE

# FPS clock
clock = time.clock()

while (True):
    clock.tick()

    try:
        img = fir.snapshot(x_size=w, y_size=h,
                           color_palette=fir.PALETTE_IRONBOW, hint=drawing_hint,
                           copy_to_fb=True)
    except OSError:
        continue

    # Print FPS.
    print(clock.fps())

# Thermal Camera Demo # # This example shows how to use common low-res FIR sensors (like MLX or AMG). # NOTE: Only the AMG8833 is currently enabled for NANO RP2040. # Higher scaling uses more memory. # or image.BILINEAR or 0 (nearest neighbor) # Initialize the thermal sensor #Auto-detects the connected sensor. # FPS clock # Print FPS.