Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
13 lines (12 sloc)
353 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use linux_embedded_hal::I2cdev; | |
use veml6030::{SlaveAddr, Veml6030}; | |
fn main() { | |
let dev = I2cdev::new("/dev/i2c-1").unwrap(); | |
let address = SlaveAddr::default(); | |
let mut sensor = Veml6030::new(dev, address); | |
sensor.enable().unwrap(); | |
loop { | |
let lux = sensor.read_lux().unwrap(); | |
println!("lux: {:2}", lux); | |
} | |
} |