Skip to content
Using BME280 sensor from Bosch at AVR mikrocontrollers like Atmega328p
C Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
Makefile
README Update README Nov 19, 2018
bme280.c
bme280.h
i2c.c
i2c.h
main.c Update main.c Feb 2, 2018

README

# bme280
Using BME280 sensor from Bosch at AVR mikrocontrollers like Atmega328p

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

Default settings for sensor are:

standby-time: 250 ms
iir-filter: 8x
temperature oversampling: 16x
pressure 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(); // in °C
  pressure = bme280_readPressure()/100.0; // in mbar
  humidity = bme280_readHumidity(); // in %
  
  for(;;){
    // main-loop
  }
  return 0; // never reached
}

For Arduino-Users:

Remember that this library is a c-library. Type

extern "C"{
  #include "lcd.h"
}

for include.
You can’t perform that action at this time.