15#ifndef _MiniR4_GroveI2C_BME280_H_
16#define _MiniR4_GroveI2C_BME280_H_
22# define ADDR_PCA954X 0x70
25#define BME280_ADDRESS 0x76
27#define BME280_REG_DIG_T1 0x88
28#define BME280_REG_DIG_T2 0x8A
29#define BME280_REG_DIG_T3 0x8C
31#define BME280_REG_DIG_P1 0x8E
32#define BME280_REG_DIG_P2 0x90
33#define BME280_REG_DIG_P3 0x92
34#define BME280_REG_DIG_P4 0x94
35#define BME280_REG_DIG_P5 0x96
36#define BME280_REG_DIG_P6 0x98
37#define BME280_REG_DIG_P7 0x9A
38#define BME280_REG_DIG_P8 0x9C
39#define BME280_REG_DIG_P9 0x9E
41#define BME280_REG_DIG_H1 0xA1
42#define BME280_REG_DIG_H2 0xE1
43#define BME280_REG_DIG_H3 0xE3
44#define BME280_REG_DIG_H4 0xE4
45#define BME280_REG_DIG_H5 0xE5
46#define BME280_REG_DIG_H6 0xE7
48#define BME280_REG_CHIPID 0xD0
49#define BME280_REG_VERSION 0xD1
50#define BME280_REG_SOFTRESET 0xE0
52#define BME280_REG_CAL26 0xE1
54#define BME280_REG_CONTROLHUMID 0xF2
55#define BME280_REG_CONTROL 0xF4
56#define BME280_REG_CONFIG 0xF5
57#define BME280_REG_PRESSUREDATA 0xF7
58#define BME280_REG_TEMPDATA 0xFA
59#define BME280_REG_HUMIDITYDATA 0xFD
94 uint8_t BME280Read8(uint8_t reg);
95 uint16_t BME280Read16(uint8_t reg);
96 uint16_t BME280Read16LE(uint8_t reg);
97 int16_t BME280ReadS16(uint8_t reg);
98 int16_t BME280ReadS16LE(uint8_t reg);
99 uint32_t BME280Read24(uint8_t reg);
100 void writeRegister(uint8_t reg, uint8_t val);
A class for interfacing with the BME280 sensor.
float getTemperature(void)
Reads the temperature from the BME280 sensor.
bool begin(int i2c_addr=BME280_ADDRESS)
Initializes the BME280 sensor.
float calcAltitude(float pressure)
Calculates the altitude based on the pressure reading.
float getHumidity(void)
Reads the humidity from the BME280 sensor.
float getPressure(void)
Reads the pressure from the BME280 sensor.