diff --git a/examples/ext_dev/sensors/thermography_mlx90640/mlx90640_example.py b/examples/ext_dev/sensors/thermography_mlx90640/mlx90640_example.py index 65ed0ada..a8d0140b 100644 --- a/examples/ext_dev/sensors/thermography_mlx90640/mlx90640_example.py +++ b/examples/ext_dev/sensors/thermography_mlx90640/mlx90640_example.py @@ -1,9 +1,20 @@ from maix import display, app, time, ext_dev +import os disp = display.Display() +I2C_BUS_NUM = 5 + +if I2C_BUS_NUM == 5: + ### 使用I2C5,尝试加载外设驱动。如果外设驱动已存在会有错误提示,忽略即可。 + ### Using I2C5, try to load the peripheral driver. + ### If the peripheral driver already exists there will be an error message, just ignore it. + os.system("insmod /mnt/system/ko/i2c-algo-bit.ko") + os.system("insmod /mnt/system/ko/i2c-gpio.ko") + + mlx = ext_dev.mlx90640.MLX90640Celsius( - 5, + I2C_BUS_NUM, ext_dev.mlx90640.FPS.FPS_32, ext_dev.cmap.Cmap.WHITE_HOT, 5, 50, 0.95)