'''
实验名称：MLX90614红外测温
实验平台：核桃派1B
'''

import time, board, busio, adafruit_mlx90614

# 构建I2C对象，使用核桃派I2C1控制
i2c = busio.I2C(board.SCL1, board.SDA1)

# 构建MLX90614对象
mlx = adafruit_mlx90614.MLX90614(i2c, address=0x5a)

while True:
    
    print("Ambent Temp: ", '%.2f'% mlx.ambient_temperature) #测量环境温度
    print("Object Temp: ", '%.2f'% mlx.object_temperature) #测量物体温度
    
    time.sleep(1)
