1
/***************************************************
2
This is a library for the BMP085 Barometric Pressure & Temp Sensor
4
Designed specifically to work with the Adafruit BMP085 Breakout
5
----> https://www.adafruit.com/products/391
7
These displays use I2C to communicate, 2 pins are required to
9
Adafruit invests time and resources providing this open source code,
10
please support Adafruit and open-source hardware by purchasing
11
products from Adafruit!
13
Written by Limor Fried/Ladyada for Adafruit Industries.
14
BSD license, all text above must be included in any redistribution
15
****************************************************/
24
#define BMP085_DEBUG 0
26
#define BMP085_I2CADDR 0x77
28
#define BMP085_ULTRALOWPOWER 0
29
#define BMP085_STANDARD 1
30
#define BMP085_HIGHRES 2
31
#define BMP085_ULTRAHIGHRES 3
32
#define BMP085_CAL_AC1 0xAA // R Calibration data (16 bits)
33
#define BMP085_CAL_AC2 0xAC // R Calibration data (16 bits)
34
#define BMP085_CAL_AC3 0xAE // R Calibration data (16 bits)
35
#define BMP085_CAL_AC4 0xB0 // R Calibration data (16 bits)
36
#define BMP085_CAL_AC5 0xB2 // R Calibration data (16 bits)
37
#define BMP085_CAL_AC6 0xB4 // R Calibration data (16 bits)
38
#define BMP085_CAL_B1 0xB6 // R Calibration data (16 bits)
39
#define BMP085_CAL_B2 0xB8 // R Calibration data (16 bits)
40
#define BMP085_CAL_MB 0xBA // R Calibration data (16 bits)
41
#define BMP085_CAL_MC 0xBC // R Calibration data (16 bits)
42
#define BMP085_CAL_MD 0xBE // R Calibration data (16 bits)
44
#define BMP085_CONTROL 0xF4
45
#define BMP085_TEMPDATA 0xF6
46
#define BMP085_PRESSUREDATA 0xF6
47
#define BMP085_READTEMPCMD 0x2E
48
#define BMP085_READPRESSURECMD 0x34
54
boolean begin(uint8_t mode = BMP085_ULTRAHIGHRES); // by default go highres
55
float readTemperature(void);
56
int32_t readPressure(void);
57
float readAltitude(float sealevelPressure = 101325); // std atmosphere
58
uint16_t readRawTemperature(void);
59
uint32_t readRawPressure(void);
62
uint8_t read8(uint8_t addr);
63
uint16_t read16(uint8_t addr);
64
void write8(uint8_t addr, uint8_t data);
68
int16_t ac1, ac2, ac3, b1, b2, mb, mc, md;
69
uint16_t ac4, ac5, ac6;