drogue-bme680

Crates.iodrogue-bme680
lib.rsdrogue-bme680
version0.3.0
sourcesrc
created_at2020-10-05 15:00:10.208807
updated_at2020-10-15 12:24:45.19696
descriptionA crate to interface with the BME680 environmental sensor
homepagehttps://blog.drogue.io
repositoryhttps://github.com/drogue-iot/drogue-bme680
max_upload_size
id296334
size89,117
Bob McWhirter (bobmcwhirter)

documentation

README

Drogue IoT BME680 Sensor driver

CI crates.io docs.rs Matrix

The BME680 sensor is a "low power gas, pressure, temperature & humidity sensor" from Bosch Sensortec.

This crate helps to interface with the sensor. Offering general purpose access to the sensor, as well as a more opinionated controller logic, simplifying the process of taking measurements.

More information

Simple example

fn main() -> ! {
  let i2c = create_blocking_i2c();
  let mut timer = create_timer();
   
  let bme680 = Bme680Sensor::from(i2c, Address::Secondary).unwrap();
  
  let mut controller = Bme680Controller::new(
    bme680,
    &mut timer,
    Configuration::standard(),
    || 25,  // fixed 25 degrees Celsius as ambient temperature
  ).unwrap();
       
  loop {
    let result = controller.measure_default().unwrap();
    log::info!("Measured: {:?}", result);
  }
}

See: examples/

BSEC

This crate can work together with the Bosch Sensortec Environmental Cluster (BSEC) library.

However, as the BSEC library is not open source, this crate does not include any dependencies, headers or other related artifacts of it. The BSEC interface is part of drogue-bsec.

Run unit tests

You can run the unit tests on simple host machine using:

cargo test --feature logging

Run examples

Run with (STM32F411):

cargo embed --release --features stm32f4xx --target thumbv7em-none-eabihf --example simple

Run with (STM32F723):

cargo embed --release --features stm32f7xx --target thumbv7em-none-eabihf --example simple

Dump data

You can enable logging of raw data, by enabling the feature dump, using --features dump. Note that this requires a logging implementation, such as rtt-logger. Note that this may have a huge negative impact on performance.

Commit count: 28

cargo fmt