Datasheet
support, etc?
Run example code
At long last, we are finally ready to run our example code
"""This example is for Raspberry Pi (Linux) only!
It will not work on microcontrollers running CircuitPython!"""
import os
import math
import time
import busio
import board
import numpy as np
import pygame
from scipy.interpolate import griddata
from colour import Color
import adafruit_amg88xx
i2c_bus = busio.I2C(board.SCL, board.SDA)
#low range of the sensor (this will be blue on the screen)
MINTEMP = 26.
#high range of the sensor (this will be red on the screen)
MAXTEMP = 32.
#how many color values we can have
COLORDEPTH = 1024
os.putenv('SDL_FBDEV', '/dev/fb1')
pygame.init()
#initialize the sensor
sensor = adafruit_amg88xx.AMG88XX(i2c_bus)
# pylint: disable=invalid-slice-index
points = [(math.floor(ix / 8), (ix % 8)) for ix in range(0, 64)]
grid_x, grid_y = np.mgrid[0:7:32j, 0:7:32j]
# pylint: enable=invalid-slice-index
#sensor is an 8x8 grid so lets do a square
height = 240
width = 240
#the list of colors we can choose from
blue = Color("indigo")
colors = list(blue.range_to(Color("red"), COLORDEPTH))
#create the array of colors
colors = [(int(c.red * 255), int(c.green * 255), int(c.blue * 255)) for c in colors]
displayPixelWidth = width / 30
displayPixelHeight = height / 30
© Adafruit Industries https://learn.adafruit.com/adafruit-amg8833-8x8-thermal-camera-sensor Page 26 of 30










