bmpe280 1.0.5

An I2C driver for the Bosch BMP280/BME280 barometer , thermometer.
Documentation
#![no_std]
#![no_main]

use esp_backtrace as _;
use esp_hal::i2c::master::{Config, I2c};
use esp_hal::{delay::Delay, main};

use esp_println::println;

#[main]
fn main() -> ! {
    let config = esp_hal::Config::default();

    let delay = Delay::new();

    let peripherals = esp_hal::init(config);
    let i2c0 = I2c::new(peripherals.I2C0, Config::default())
        .unwrap()
        .with_sda(peripherals.GPIO3)
        .with_scl(peripherals.GPIO1);
    use bmpe280::bmp280::BMP280;
    //
    // to create sensor with default configuration:
    let mut bmp = BME280::new(i2c0);

    loop {
        let m = bmp.measure();

        // // 获取大气压:
        println!(
            "2:temperature:{0}℃, pressure:{1},humidity:{2}%",
            m.temperature, m.pressure, m.humidity
        );

        delay.delay_millis(1000);
    }
}