#pressure-sensor #mems #compass #embedded-hal-driver #accelerometer #no-std-driver

no-std bmp280-ehal

A platform agnostic driver to interface with the BMP280 pressure sensor

5 releases

Uses old Rust 2015

0.0.6 May 27, 2023
0.0.5 Dec 16, 2020
0.0.3 Nov 28, 2018
0.0.2 Nov 14, 2018
0.0.1 Oct 17, 2018

#654 in Embedded development

MIT license

15KB
288 lines

bmp280

no_std driver for the bmp280 (pressure sensor).

Build Status

What works

  • Pressure sensor

Supported chips

  • BMP280;

Basic usage

Include library as a dependency in your Cargo.toml :

[dependencies.bmp280-ehal]
version = "<version>"

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

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

// to create sensor with default configuration:
let mut bmp = bmp280_ehal::BMP280::new(i2c)?;
// to get pressure:
let pres = bmp.pressure();
println!("{:?}", pres);

More examples

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

Documentation

API Docs available on docs.rs.

License

Dependencies

~71KB