Crates.io | max44009 |
lib.rs | max44009 |
version | 0.2.0 |
source | src |
created_at | 2018-10-19 16:03:06.696841 |
updated_at | 2021-09-12 13:03:46.053651 |
description | Platform-agnostic Rust driver for the MAX44009 ambient light sensor. |
homepage | https://github.com/eldruin/max44009-rs |
repository | https://github.com/eldruin/max44009-rs |
max_upload_size | |
id | 91518 |
size | 45,008 |
This is a platform agnostic Rust driver for the MAX44009 and MAX44007 ambient
light sensors, using the embedded-hal
traits.
This driver allows you to:
The MAX44009 and MAX44007 ambient light sensor feature an I2C digital output that is ideal for a number of portable applications such as smartphones, notebooks, and industrial sensors. At less than 1μA operating current, the MAX44009 is the lowest power ambient light sensor in the industry and features an ultra-wide 22-bit dynamic range from 0.045 lux to 188,000 lux. Low-light operation allows easy operation in dark-glass applications. The on-chip photodiode's spectral response is optimized to mimic the human eye's perception of ambient light and incorporates IR and UV blocking capability. The adaptive gain block automatically selects the correct lux range to optimize the counts/lux.
Datasheets: MAX44007, MAX44009
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 max44009::{Max44009, SlaveAddr};
fn main() {
let dev = I2cdev::new("/dev/i2c-1").unwrap();
let mut sensor = Max44009::new(dev, SlaveAddr::default());
let lux = sensor.read_lux().unwrap();
println!("lux: {}", lux);
}
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.