Simple test
Ensure your device works with this simple test.
examples/mlx90395_simpletest.py
1# SPDX-FileCopyrightText: 2020 by Bryan Siepert, written for Adafruit Industries
2#
3# SPDX-License-Identifier: Unlicense
4from time import sleep
5
6import board
7import busio
8
9from adafruit_mlx90395 import MLX90395
10
11i2c = busio.I2C(board.SCL, board.SDA)
12sensor = MLX90395(i2c)
13
14while True:
15 print("X:{0:5.2f}, Y:{1:5.2f}, Z:{2:5.2f} uT".format(*sensor.magnetic))
16 print("")
17
18 sleep(0.5)