#embedded-hal-driver #accelerometer #compass #MEMS

no-std lsm303c

A platform agnostic driver to interface with the LSM303C (accelerometer + compass)

6 releases

0.1.5 Oct 24, 2018
0.1.4 Oct 21, 2018

#146 in Hardware support

Download history 26/week @ 2018-10-27 56/week @ 2018-11-03 27/week @ 2018-11-10 13/week @ 2018-11-17 8/week @ 2018-11-24 13/week @ 2018-12-01 39/week @ 2018-12-08 11/week @ 2018-12-15 7/week @ 2018-12-22 12/week @ 2018-12-29 2/week @ 2019-01-05 6/week @ 2019-01-12 13/week @ 2019-01-19

27 downloads per month

MIT/Apache

38KB
834 lines

lsm303c

no_std driver for the lsm303c (accelerometer + magnetometer/compass).

Build Status

What works

  • To be tested

Supported chips

  • LSM303C;

Basic usage

Include library as a dependency in your Cargo.toml crates.io:

[dependencies.lsm303c]
version = "<version>"

Use embedded-hal implementation to get I2C handle and delay then create lsm303c handle:

extern crate lsm303c; // or just use lsm303c; if 2018 edition is used.

// to create sensor with default configuration:
let mut lsm = LSM303::default(l2c, &mut delay)?;
// to get all supported measurements:
let all = marg.all()?;
println!("{:?}", all);

More examples

Number of examples can be found in proving-ground repo.

Documentation

API Docs available on docs.rs.

License

Licensed under either of

at your option.

Testimonials

Started off as a fork of japaric's lsm303ldhc repo.

Dependencies

~1.5MB
~31K SLoC