-
Notifications
You must be signed in to change notification settings - Fork 4
/
README
42 lines (32 loc) · 1.06 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 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:...).
example 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(0);
// 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
}