Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README

# bme280
Using BME/BMP280 sensor from Bosch at AVR mikrocontrollers like Atmega328p

This Library allowed you to use up to two BME/BMP280 to sense temperature, pressure and humidity (only with BME280) with AVR microcontroller like Atmega328.
For communication with the BME/BMP280 I'll use my own I2C library (settings for I2C in i2c.h).

Default settings for sensors are:

standby-time: 250 ms
iir-filter: 8x
temperature oversampling: 16x
pressure oversampling: 16x
humidity oversampling: 16x
mode: normal

If you want to change this settings edit bme280.h (look at /* TODO:...).


examble source-code:

/*************BME280 examble*************/
#include <stdlib.h>
#include "bme280.h"

int main(void){
  // variables for sensor values
  float temperature = 0.0;
  float pressure = 0.0;
  float humidity = 0.0;
  
  // init sensor
  bme280_init();
  // read values
  temperature = bme280_readTemperature(0); // in °C
  pressure = bme280_readPressure(0)/100.0; // in mbar
  humidity = bme280_readHumidity(0); // in %
  
  for(;;){
    // main-loop
  }
  return 0; // never reached
}

About

Using BME280 sensor from Bosch at AVR mikrocontrollers like Atmega328p

Topics

Resources

License

Packages

No packages published
You can’t perform that action at this time.