Crates.io | tsl256x |
lib.rs | tsl256x |
version | 0.1.0 |
source | src |
created_at | 2018-07-13 11:54:29.980629 |
updated_at | 2018-07-13 11:54:29.980629 |
description | Platform agnostic driver for TSL256x series light intensity sensors built using the embedded-hal |
homepage | |
repository | https://github.com/JoshMcguigan/tsl256x |
max_upload_size | |
id | 74021 |
size | 20,349 |
Platform agnostic driver for TSL256x series of light intensity sensors built using the embedded-hal
extern crate tsl256x;
use tsl256x::{Tsl2561, SlaveAddr};
let sensor = Tsl2561::new(&mut i2c, SlaveAddr::default().addr()).unwrap();
sensor.power_on(&mut i2c);
// Note sensor readings are zero until one integration period (default 400ms) after power on
iprintln!(&mut cp.ITM.stim[0], "IR+Visible: {}, IR Only: {}",
sensor.visible_and_ir_raw(&mut i2c).unwrap(),
sensor.ir_raw(&mut i2c).unwrap());
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.