Crates.io | veml6075 |
lib.rs | veml6075 |
version | 0.2.1 |
source | src |
created_at | 2018-10-13 18:13:16.506333 |
updated_at | 2021-06-06 10:36:40.730979 |
description | Platform-agnostic Rust driver for the VEML6075 UVA and UVB light sensor. |
homepage | https://github.com/eldruin/veml6075-rs |
repository | https://github.com/eldruin/veml6075-rs |
max_upload_size | |
id | 89734 |
size | 40,142 |
This is a platform agnostic Rust driver for the VEML6075 UVA and UVB light sensor,
based on the embedded-hal
traits.
This driver allows you to:
enable()
.read()
.read_uva_raw()
.set_integration_time()
.set_dynamic_setting()
.set_mode()
.trigger_measurement()
.read_device_id()
.The VEML6075 senses UVA and UVB light and incorporates photodiode, amplifiers, and analog / digital circuits into a single chip using a CMOS process. When the UV sensor is applied, it is able to detect UVA and UVB intensity to provide a measure of the signal strength as well as allowing for UVI measurement.
The VEML6075 provides excellent temperature compensation capability for keeping the output stable under changing temperature. VEML6075's functionality is easily operated via the simple command format of I2C (SMBus compatible) interface protocol. VEML6075's operating voltage ranges from 1.7 V to 3.6 V.
Datasheet:
Application note:
To use this driver, import this crate and an embedded_hal
implementation,
then instantiate the device.
Please find additional examples using hardware in this repository: driver-examples
use linux_embedded_hal::I2cdev;
use veml6075::{Calibration, Veml6075};
fn main() {
let dev = I2cdev::new("/dev/i2c-1").unwrap();
let mut sensor = Veml6075::new(dev, Calibration::default());
let m = sensor.read().unwrap();
println!("UVA: {:2}, UVB: {:2}, UVI: {:2}", m.uva, m.uvb, m.uv_index);
}
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.