bmp280

Crates.iobmp280
lib.rsbmp280
version0.4.0
sourcesrc
created_at2016-07-14 01:36:52.438141
updated_at2021-03-11 06:38:56.252058
descriptionA simple library for using the Bosch BMP280 barometer and altimeter
homepagehttps://github.com/natemara/bmp280
repositoryhttps://github.com/natemara/bmp280
max_upload_size
id5662
size17,609
Lily Mara (lily-mara)

documentation

https://docs.rs/bmp280

README

BMP280

A simple library for using the Bosch BMP280 barometer and altimeter.

The following example can be run using $ cargo run --example simple. This library has been tested on an Odroid-C4 using an Adafruit BMP280 module.

use bmp280::Bmp280Builder;

fn main() {
    let mut dev = Bmp280Builder::new()
        .path("/dev/i2c-1")
        .address(0x77)
        .build()
        .expect("Failed to build device");

    dev.zero().expect("Device failed to zero");

    loop {
        println!("{:?} kPa", dev.pressure_kpa().unwrap());
        println!("{:?} m", dev.altitude_m().unwrap());
        println!("{:?} c", dev.temperature_celsius().unwrap());
        std::thread::sleep(std::time::Duration::from_millis(250));
    }

}
Commit count: 31

cargo fmt