Crates.io | mlx9061x |
lib.rs | mlx9061x |
version | 0.3.0 |
source | src |
created_at | 2020-07-29 19:02:48.267108 |
updated_at | 2024-05-23 19:15:20.242623 |
description | Platform-agnostic Rust driver for the MLX90614 and MLX90615 non-contact infrared thermometers. |
homepage | https://github.com/eldruin/mlx9061x-rs |
repository | https://github.com/eldruin/mlx9061x-rs |
max_upload_size | |
id | 271043 |
size | 68,197 |
This is a platform agnostic Rust driver for the MLX90614/MLX90615 infrared
thermometers using the embedded-hal
traits.
This driver allows you to:
object1_temperature()
.ambient_temperature()
.raw_ir_channel1()
.set_emissivity()
.device_id()
.set_address()
.sleep()
.wake_mlx90614()
.The MLX90614/MLX90615 are a infrared thermometers for non-contact temperature measurements. Both the IR sensitive thermopile detector chip and the signal conditioning ASSP are integrated in the same TO-39/TO-46 can. Thanks to its low noise amplifier, 17-bit/16-bit ADC and powerful DSP unit, a high accuracy and resolution of the thermometer is achieved.
Depending on the MLX90614 model they feature a single-zone or dual-zone thermopile.
The chips feature an 10-bit PWM and SMBus interface.
The readout resolution is 0.01°C (MLX90614) / 0.02°C (MLX90615).
This driver uses the SMBus interface.
Documentation:
To use this driver, import this crate and an embedded_hal
implementation,
then instantiate the appropriate device.
Please find additional examples using hardware in this repository: driver-examples
use linux_embedded_hal::I2cdev;
use mlx9061x::{Mlx9061x, SlaveAddr};
fn main() {
let dev = I2cdev::new("/dev/i2c-1").unwrap();
let addr = SlaveAddr::default();
let mut sensor = Mlx9061x::new_mlx90614(dev, addr, 5).unwrap();
loop {
let obj_temp = sensor.object1_temperature().unwrap();
println!("Object temperature: {:.2}ºC", obj_temp);
}
}
To enable defmt (version 0.3.x
) support, when specifying the dependency on mlx9061x
, add the feature "defmt-03
".
[dependencies]
mlx9061x = { version = "0.3.0", features = ["defmt-03"] }
For questions, issues, feature requests, and other changes, please file an issue in the github project.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.