项目作者: heyitsanthony

项目描述 :
An embedded-hal rust no_std driver for the QMC5883L magnetometer chip.
高级语言: Rust
项目地址: git://github.com/heyitsanthony/qmc5883l.git
创建时间: 2019-06-28T18:59:31Z
项目社区:https://github.com/heyitsanthony/qmc5883l

开源协议:GNU Affero General Public License v3.0

下载


QMC5883L

An embedded rust no_std driver for the QMC5883L magnetometer chip.

Usage

Include library as a dependency in your Cargo.toml:

  1. [dependencies.qmc5883l]
  2. version = "<version>"

To use the sensor, call QMC5883L::new with an embedded-hal i2c device:

  1. extern crate qmc5883l;
  2. // Create the sensor in soft-reset mode.
  3. let mut dev = QMC5883L::new(i2c_dev).unwrap();
  4. // Enable data collection.
  5. dev.continuous().unwrap();
  6. // Get magnetometer (x,y,z) measurement.
  7. let (x, y, z) = dev.mag().unwrap();

Documentation

API documentation is generated on docs.rs.

License

Licensed under AGPL-3.0.