Skip to content

sousandrei/iis2mdc

Repository files navigation

Build Status Docs.rs Crates.io

Table of Contents

About the Project 📃

This is a simple driver for ST's iis2mdc sensor.

Documentation for that sensor can be found at ST's website

Usage 👀

Check out the examples folder for simple implementation

To declare a sensor is pretty simple:

let mut sensor = Iis2mdc::new(&mut i2c).unwrap();

To configure the sensor, use the high-level methods:

use iis2mdc::{CfgRegAConfig, Odr};

sensor.set_odr(&mut i2c, Odr::Hz50).unwrap();
sensor.set_comp_temp_en(&mut i2c, true).unwrap();

To read measurements:

use iis2mdc::Magnetometer;

let mag = sensor.get_magnetometer(&mut i2c).unwrap();
println!("Mag: {:?}", mag.as_ut());

Help wanted 🤝

All contributions are welcome!

If you are using or plan to use this create don't hesitate to open an issue or a PR.

License

See LICENSE for more details.

About

Crate for driving the iis2mdc sensor from ST

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages