| Crates.io | bmp280-driver |
| lib.rs | bmp280-driver |
| version | 0.0.7 |
| created_at | 2021-11-16 01:47:05.855878+00 |
| updated_at | 2021-11-16 01:51:50.738851+00 |
| description | A platform agnostic driver to interface with the BMP280 pressure sensor |
| homepage | |
| repository | https://github.com/nnarain/bmp280 |
| max_upload_size | |
| id | 482441 |
| size | 14,211 |
bmp280no_std driver for the bmp280 (pressure sensor).
BMP280;
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);
Number of examples can be found in proving-ground repo.
API Docs available on docs.rs.