Simple test

Ensure your device works with this simple test.

examples/mlx90614_simpletest.py
 1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
 2# SPDX-License-Identifier: MIT
 3
 4#  Designed specifically to work with the MLX90614 sensors in the
 5#  adafruit shop
 6#  ----> https://www.adafruit.com/product/1747
 7#  ----> https://www.adafruit.com/product/1748
 8#
 9#  These sensors use I2C to communicate, 2 pins are required to
10#  interface Adafruit invests time and resources providing this open
11#  source code,
12#  please support Adafruit and open-source hardware by purchasing
13#  products from Adafruit!
14
15import board
16import adafruit_mlx90614
17
18# The MLX90614 only works at the default I2C bus speed of 100kHz.
19# A higher speed, such as 400kHz, will not work.
20i2c = board.I2C()  # uses board.SCL and board.SDA
21# i2c = board.STEMMA_I2C()  # For using the built-in STEMMA QT connector on a microcontroller
22mlx = adafruit_mlx90614.MLX90614(i2c)
23
24# temperature results in celsius
25print("Ambent Temp: ", mlx.ambient_temperature)
26print("Object Temp: ", mlx.object_temperature)