This is a platform agnostic Rust driver for the VEML6075 UVA and UVB
light sensor, based on the
This driver allows you to:
- Enable/disable the sensor
- Read the UVA measurement
- Read the UVB measurement
- Read the UVcomp1 measurement
- Read the UVcomp2 measurement
- Read the 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 easilyoperated via the simple command format of I2C (SMBus compatible) interface protocol. VEML6075's operating voltage ranges from 1.7 V to 3.6 V.
//! ## Usage examples (see also examples folder)
Import this crate and an
embedded_hal implementation, then instantiate
extern crate linux_embedded_hal as hal; extern crate veml6075; use hal::I2cdev; use veml6075::VEML6075; let dev = I2cdev::new("/dev/i2c-1").unwrap(); let mut uv_light_sensor = VEML6075::new(dev); uv_light_sensor.enable().unwrap(); let _uva_reading = uv_light_sensor.read_uva().unwrap(); let _uvb_reading = uv_light_sensor.read_uvb().unwrap();
VEML6075 device driver.
All possible errors in this crate