/ examples / mlx90614_simpletest.py
mlx90614_simpletest.py
 1  #  Designed specifically to work with the MLX90614 sensors in the
 2  #  adafruit shop
 3  #  ----> https://www.adafruit.com/product/1747
 4  #  ----> https://www.adafruit.com/product/1748
 5  #
 6  #  These sensors use I2C to communicate, 2 pins are required to
 7  #  interface Adafruit invests time and resources providing this open
 8  #  source code,
 9  #  please support Adafruit and open-source hardware by purchasing
10  #  products from Adafruit!
11  
12  import board
13  import busio as io
14  import adafruit_mlx90614
15  
16  # the mlx90614 must be run at 100k [normal speed]
17  # i2c default mode is is 400k [full speed]
18  # the mlx90614 will not appear at the default 400k speed
19  i2c = io.I2C(board.SCL, board.SDA, frequency=100000)
20  mlx = adafruit_mlx90614.MLX90614(i2c)
21  
22  # temperature results in celsius
23  print("Ambent Temp: ", mlx.ambient_temperature)
24  print("Object Temp: ", mlx.object_temperature)