Skip to main content

MLX90640-41 的 Python 库

项目描述

介绍

这个用于 MLX90640 和 MLX90641 的 python 驱动程序旨在促进 PC 上的接口。

目前该驱动支持 3 种类型的接口:

依赖项

司机:

  • Python3
  • pySerial

入门

安装

pip install mlx9064x-driver

运行驱动程序演示

  • 将 EVB 连接到您的 PC。
  • 打开终端并运行以下命令:
mlx9064x-dump-frame auto

该程序采用 1 个可选参数。

mlx9064x-dump-frame <communication-port>

<communication-port>可:

  • auto(默认)搜索与 EVB90640 硬件的兼容性作为 MLX90640 或 MLX90641 的接口。
  • COMx用于 EVB90640 HW 的 windows 平台上的 comport,其中 x 是 comport 号。
  • /dev/ttyUSBx用于 EVB90640 HW 的 Linux 平台上的 comport,其中 x 是 comport 号。
  • /dev/ttyACMx用于 EVB90640 HW 的树莓派 Linux 平台上的 comport,其中 x 是 comport 号。
  • I2C-1在树莓派上使用 I2C 硬件;它需要 raspi-config 来启用 i2c 硬件。
  • I2CBB-<sda>-<scl>[I2CBB-03-05] 在树莓派上,在任何 GPIO 引脚上 使用B it B anging 软件 I2C。
    • <sda>是物理引脚的 2 位数字(默认值:03)
    • <scl>是物理引脚的 2 位数字(默认值:05)

注意:物理引脚编号:请参见此图中右侧的编号:https ://pinout.xyz/

用法

您可以在下面找到一个示例,说明如何读取 MLX90640 传感器的帧,I2C 地址为 0x33,帧速率为 8Hz。请查看 EVB90640.py 以获得更多高级功能。

import mlx.mlx90640 as mlx

dev = mlx.Mlx9064x('COM4', i2c_addr=0x33, frame_rate=8.0) # establish communication between EVB90640 and
                                                          # PC, the I2C address of the MLX90640 sensor is
                                                          # 0x33 and change the frame rate to 8Hz
dev.init()                      # read EEPROM and pre-compute calibration parameters.
frame = dev.read_frame()        # Read a frame from MLX90640
                                # In case EVB90640 hw is used, the EVB will buffer up to 4 frames, so possibly you get a cached frame.
f = dev.do_compensation(frame)  # calculates the temperatures for each pixel

问题和新功能

如果您对插件的使用有任何问题,请在 GitHub 上打开一个问题。
提供尽可能多的有效信息,因为这将有助于我们更快地解决问题。
我们还想听听您对有助于您的持续集成更好地运行的新功能的建议。

树莓派 3B+

此驱动程序经验证可在 raspbian buster 2020 年 2 月版的 Rapberry Pi 3B+ 配置上运行。

安装

  • sudo raspi-config
    • 在界面中“启用 i2c”;如果您想在 RPi 的 I2C 总线上连接 MLX9064x。
    • 可选:在界面中“启用 ssh”;现在您可以通过网络远程登录。
  • sudo pip3 install virtualenv
  • 可选的:sudo apt-get update
  • 可选的:sudo apt-get install python3-opencv
  • 可选的:sudo apt-get install qt5-default
  • 可选的:sudo apt-get install libatlas-base-dev
  • 可选的:sudo apt-get install python3-scipy
  • cd <mlx90640-py>
  • virtualenv --system-site-packages pyvenv
  • . pyvenv/bin/activate
  • pip install .

笔记:

  • 的输出sudo apt-get update必须如下所示:
Get:1 http://archive.raspberrypi.org/debian buster InRelease [25.2 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:3 http://archive.raspberrypi.org/debian buster/main armhf Packages [259 kB]
Get:4 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Fetched 13.3 MB in 17s (767 kB/s)
Reading package lists... Done

下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

mlx9064x-driver-1.3.0.tar.gz (23.2 kB 查看哈希

已上传 source

内置分布

mlx9064x_driver-1.3.0-py3-none-any.whl (25.5 kB 查看哈希

已上传 py3