bh1750-ehal

Crates.iobh1750-ehal
lib.rsbh1750-ehal
version0.0.2
sourcesrc
created_at2019-05-29 15:33:16.946244
updated_at2019-05-29 20:07:39.007843
descriptionDriver fro BH1750 is an digital Ambient Light Sensor IC for I2C bus interface.
homepage
repositoryhttps://github.com/satsuta/bh1750
max_upload_size
id137719
size5,110
(satsuta)

documentation

README

BH1750-ehal

Driver fro BH1750 is an digital Ambient Light Sensor IC for I2C bus interface.

let mut i2c = I2c::i2c3(p.I2C3, (scl, sda), 400.khz(), clocks);
let mut delay = Delay::new(cmp.SYST, clocks);
let mut bh1750 = BH1750::new(i2c, delay, Address::ADDR_L).unwrap();
let light = hb1750.light_one_shot(OneTimeMeasurement::LOW_RES);
let light = bh1750.get_measurement(ContinuesMeasurement::LOW_RES);
println!("light {:.1} \n", light);
Commit count: 3

cargo fmt