4个版本

0.2.1 2022年5月19日
0.2.0 2022年4月22日
0.1.1 2022年4月20日
0.1.0 2022年4月20日

#235 in #embedded-hal-driver

MIT/Apache

16KB
263

MICS-VZ-89TE 驱动

此驱动程序可用于读取MICS-VZ-89TE传感器的CO2和VOC测量值。

Build Status License Crates.io Documentation

示例用法

示例展示了如何从传感器读取CO2和VOC。

let mut delay = ...; // delay struct from board
let i2c = ...; // I2C bus to use

let mut device = MicsVz89Te::new(i2c);
let measurements = device.read_measurements(&mut delay).unwrap();

let co2 = measurements.co2;
let voc = measurements.voc;

let i2c = device.release(); // destruct driver to use bus with other drivers

lib.rs:

MICS-VZ-89TE传感器驱动程序

此驱动程序可用于读取MICS-VZ-89TE传感器的CO2和voc测量值。CO2的测量范围为400至2000ppm。VOC的测量范围为0至1000ppb。根据数据表,传感器启动时需要大约15分钟才能提供有效的CO2值。

要使用此驱动程序,必须将I2C总线设置为最大波特率为100_000。

功能标志

  • std:启用使用std::error::Error的错误处理。
  • time:使结构体RevisionDatetime::Date兼容。
  • unproven:启用ppm校准和r0值获取。(无法验证正确功能。)

示例用法

let mut delay = ...; // delay struct from board
let i2c = ...; // I2C bus to use

let mut device = MicsVz89Te::new(i2c);
let measurements = device.read_measurements(&mut delay).unwrap();

let co2 = measurements.co2;
let voc = measurements.voc;

let i2c = device.release(); // destruct driver to use bus with other drivers

依赖项

~240KB