| Crates.io | bh1750-ehal |
| lib.rs | bh1750-ehal |
| version | 0.0.2 |
| created_at | 2019-05-29 15:33:16.946244+00 |
| updated_at | 2019-05-29 20:07:39.007843+00 |
| description | Driver fro BH1750 is an digital Ambient Light Sensor IC for I2C bus interface. |
| homepage | |
| repository | https://github.com/satsuta/bh1750 |
| max_upload_size | |
| id | 137719 |
| size | 5,110 |
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);