Crates.io | hrs3300 |
lib.rs | hrs3300 |
version | 0.1.0 |
source | src |
created_at | 2020-04-25 08:31:02.308087 |
updated_at | 2020-04-25 08:31:02.308087 |
description | Platform-agnostic Rust driver for the HRS3300 heart rate sensor/monitor. |
homepage | https://github.com/eldruin/hrs3300-rs |
repository | https://github.com/eldruin/hrs3300-rs |
max_upload_size | |
id | 233878 |
size | 44,991 |
This is a platform agnostic Rust driver for the HRS3300 optical heart rate
sensor using the embedded-hal
traits.
This driver allows you to:
enable_hrs()
.enable_oscillator()
.init()
.set_conversion_delay()
.set_gain()
.set_als_resolution()
.set_led_current()
.device_id()
.read_hrs()
.read_als()
.write_register()
.HRSS3300 is an optical digital heart rate sensor/monitor featuring a 525nm green LED and a reflection light detector for the PPG signal from the human body. The typical heart rate measurement samples the reflected PPG signal at 25Hz then the results can be read via the I2C bus.
Datasheet:
To use this driver, import this crate and an embedded_hal
implementation,
then instantiate the device.
extern crate hrs3300;
extern crate linux_embedded_hal as hal;
use hrs3300::Hrs3300;
fn main() {
let dev = hal::I2cdev::new("/dev/i2c-1").unwrap();
let mut sensor = Hrs3300::new(dev);
sensor.init().unwrap();
sensor.enable_hrs().unwrap();
sensor.enable_oscillator().unwrap();
loop {
let hrs = sensor.read_hrs().unwrap();
let als = sensor.read_als().unwrap();
println!("HRS: {}, ALS: {}", hrs, als);
}
}
For questions, issues, feature requests, and other changes, please file an issue in the github project.
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.