bmp180 library

hi all.

i have purchased a BMP180 prssure sensor temp sensor thingo. and i cant get a library for it anywhere. i have scoured the net looking for one, and all i can find is a bmp085. i have fount the bmp185 library on the loveelectronics site. but it keeps giving me a web page not found error. i read that its the same as the bmp085, so i tried that library, but upon sketching i keep getting an error.

here it is:

In file included from sensorapi.pde:2:
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:9: error: stray ‘\302’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:9: error: stray ‘\267’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:9: error: stray ‘\302’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:9: error: stray ‘\267’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
In file included from C:\Program Files (x86)\Arduino\libraries\Adafruit_BMP085_Unified/Adafruit_BMP085_U.h:26,
from sensorapi.pde:3:
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:9: error: stray ‘\302’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:9: error: stray ‘\267’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:9: error: stray ‘\302’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:9: error: stray ‘\267’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: stray ‘#’ in program
In file included from sensorapi.pde:2:
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:4: error: expected unqualified-id before ‘<’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘<’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘=’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘<’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected constructor, destructor, or type conversion before ‘.’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘<’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘<’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘.’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘<’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘<’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected constructor, destructor, or type conversion before ‘.’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘<’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘<’ token
C:\Program Files (x86)\Arduino\libraries\Adafruit_Sensor/Adafruit_Sensor.h:608: error: expected unqualified-id before ‘<’ token

i am very new to all this, and i have no idea where the error is. as i am trying to use their samble code.

cheers

Jason

The library source code appears to be full of non-ASCII characters - try looking with an editor at the Adafruit_Senser.h you have - perhaps it got corrupted? Did you uncompress it properly?

himate. i dont know. i downloaded it from the git hub that i found. i simply saved it onto my pc in the libraries folder. is there a text editor for looking at them? as iopened it up with notepad, and it dosent word wrap well and is impossible to read.

git hub i downloaded the library from: https://github.com/adafruit/Adafruit_Sensor

cheers

jason

himate. i dont know. i downloaded it from the git hub that i found. i simply saved it onto my pc in the libraries folder. is there a text editor for looking at them? as iopened it up with notepad, and it dosent word wrap well and is impossible to read.

git hub i downloaded the library from: https://github.com/adafruit/Adafruit_Sensor

cheers

jason

notepad is hopeless, use a proper text editor.

Ok i have opened it in the git hub editor. But i havent a clue what im looking for. Is there a way i can atleast findout what line the error is on?

Cheers

Jasob

haha. all good. i must have downloaded a corrupt version. as i tried it again, and it works a treat.

thanks all.

Jason

It is my understanding that the communication with the BMP180 is identical to the BMP085. You can use the same library.

Be aware that several of the libraries for this device on the internet have bugs in them. They don't work properly. I eventually wrote my own.

Interesting. Could i get a copy of your library? How much better is it than the one i would have? And what are the improvments over it?

Cheers

Jason

Hi, you said:

michinyon: Be aware that several of the libraries for this device on the internet have bugs in them. They don't work properly. I eventually wrote my own.

Ok, which one is not corrupted? Any suggestion which one I should use ? ragds, OH

Jason,

I’ve put together this code that I use. Copy and paste it in your IDE and give it a try.

/**********************************************************
  Bosch Pressure Sensor BMP085 / BMP180 readout routine
  for the Arduino platform.
   
  Compiled by Leo Nutz
  www.ALTDuino.de              
 **********************************************************/

#include <Wire.h>

#define ADDRESS_SENSOR 0x77                 // Sensor address

int16_t  ac1, ac2, ac3, b1, b2, mb, mc, md; // Store sensor PROM values from BMP180
uint16_t ac4, ac5, ac6;                     // Store sensor PROM values from BMP180
// Ultra Low Power       OSS = 0, OSD =  5ms
// Standard              OSS = 1, OSD =  8ms
// High                  OSS = 2, OSD = 14ms
// Ultra High Resolution OSS = 3, OSD = 26ms
const uint8_t oss = 3;                      // Set oversampling setting
const uint8_t osd = 26;                     // with corresponding oversampling delay 

float T, P;                                 // Set global variables for temperature and pressure 

void setup()
{
  Wire.begin();                             // Activate I2C
  
  Serial.begin(9600);                       // Set up serial port

  init_SENSOR();                            // Initialize baro sensor variables
  delay(100);
}

void loop()
{
  int32_t b5;
 
  b5 = temperature();                       // Read and calculate temperature (T) 

  Serial.print("Temperature: ");
  Serial.print(T, 2);
  Serial.print(" C, ");
  Serial.print(1.8 * T + 32.0, 2);
  Serial.println(" F");

  P = pressure(b5);                         // Read and calculate pressure (P) 

  Serial.print("Pressure: ");
  Serial.print(P, 2);
  Serial.print(" mbar, ");
  Serial.print(P * 0.0295299830714, 2);
  Serial.println(" inHg");
  Serial.println("");

  delay(500);                               // Delay between each readout
  
}

/**********************************************
  Initialize sensor variables
 **********************************************/
void init_SENSOR()
{
  ac1 = read_2_bytes(0xAA);
  ac2 = read_2_bytes(0xAC);
  ac3 = read_2_bytes(0xAE);
  ac4 = read_2_bytes(0xB0);
  ac5 = read_2_bytes(0xB2);
  ac6 = read_2_bytes(0xB4);
  b1  = read_2_bytes(0xB6);
  b2  = read_2_bytes(0xB8);
  mb  = read_2_bytes(0xBA);
  mc  = read_2_bytes(0xBC);
  md  = read_2_bytes(0xBE);

  Serial.println("");
  Serial.println("Sensor calibration data:");
  Serial.print(F("AC1 = ")); Serial.println(ac1);
  Serial.print(F("AC2 = ")); Serial.println(ac2);
  Serial.print(F("AC3 = ")); Serial.println(ac3);
  Serial.print(F("AC4 = ")); Serial.println(ac4);
  Serial.print(F("AC5 = ")); Serial.println(ac5);
  Serial.print(F("AC6 = ")); Serial.println(ac6);
  Serial.print(F("B1 = "));  Serial.println(b1);
  Serial.print(F("B2 = "));  Serial.println(b2);
  Serial.print(F("MB = "));  Serial.println(mb);
  Serial.print(F("MC = "));  Serial.println(mc);
  Serial.print(F("MD = "));  Serial.println(md);
  Serial.println("");
}

/**********************************************
  Calcualte pressure readings
 **********************************************/
float pressure(int32_t b5)
{
  int32_t x1, x2, x3, b3, b6, p, UP;
  uint32_t b4, b7; 

  UP = read_pressure();                         // Read raw pressure

  b6 = b5 - 4000;
  x1 = (b2 * (b6 * b6 >> 12)) >> 11; 
  x2 = ac2 * b6 >> 11;
  x3 = x1 + x2;
  b3 = (((ac1 * 4 + x3) << oss) + 2) >> 2;
  x1 = ac3 * b6 >> 13;
  x2 = (b1 * (b6 * b6 >> 12)) >> 16;
  x3 = ((x1 + x2) + 2) >> 2;
  b4 = (ac4 * (uint32_t)(x3 + 32768)) >> 15;
  b7 = ((uint32_t)UP - b3) * (50000 >> oss);
  if(b7 < 0x80000000) { p = (b7 << 1) / b4; } else { p = (b7 / b4) << 1; } // or p = b7 < 0x80000000 ? (b7 * 2) / b4 : (b7 / b4) * 2;
  x1 = (p >> 8) * (p >> 8);
  x1 = (x1 * 3038) >> 16;
  x2 = (-7357 * p) >> 16;
  return (p + ((x1 + x2 + 3791) >> 4)) / 100.0f; // Return pressure in mbar
}

/**********************************************
  Read uncompensated temperature
 **********************************************/
int32_t temperature()
{
  int32_t x1, x2, b5, UT;

  Wire.beginTransmission(ADDRESS_SENSOR); // Start transmission to device 
  Wire.write(0xf4);                       // Sends register address
  Wire.write(0x2e);                       // Write data
  Wire.endTransmission();                 // End transmission
  delay(5);                               // Datasheet suggests 4.5 ms
  
  UT = read_2_bytes(0xf6);                // Read uncompensated TEMPERATURE value

  // Calculate true temperature
  x1 = (UT - (int32_t)ac6) * (int32_t)ac5 >> 15;
  x2 = ((int32_t)mc << 11) / (x1 + (int32_t)md);
  b5 = x1 + x2;
  T  = (b5 + 8) >> 4;
  T = T / 10.0;                           // Temperature in celsius 
  return b5;  
}

/**********************************************
  Read uncompensated pressure value
 **********************************************/
int32_t read_pressure()
{
  int32_t value; 
  Wire.beginTransmission(ADDRESS_SENSOR);   // Start transmission to device 
  Wire.write(0xf4);                         // Sends register address to read from
  Wire.write(0x34 + (oss << 6));            // Write data
  Wire.endTransmission();                   // SEd transmission
  delay(osd);                               // Oversampling setting delay
  Wire.beginTransmission(ADDRESS_SENSOR);
  Wire.write(0xf6);                         // Register to read
  Wire.endTransmission();
  Wire.requestFrom(ADDRESS_SENSOR, 3);      // Request three bytes
  if(Wire.available() >= 3)
  {
    value = (((int32_t)Wire.read() << 16) | ((int32_t)Wire.read() << 8) | ((int32_t)Wire.read())) >> (8 - oss);
  }
  return value;                             // Return value
}

/**********************************************
  Read 1 byte from the BMP sensor
 **********************************************/
uint8_t read_1_byte(uint8_t code)
{
  uint8_t value;
  Wire.beginTransmission(ADDRESS_SENSOR);         // Start transmission to device 
  Wire.write(code);                               // Sends register address to read from
  Wire.endTransmission();                         // End transmission
  Wire.requestFrom(ADDRESS_SENSOR, 1);            // Request data for 1 byte to be read
  if(Wire.available() >= 1)
  {
    value = Wire.read();                          // Get 1 byte of data
  }
  return value;                                   // Return value
}

/**********************************************
  Read 2 bytes from the BMP sensor
 **********************************************/
uint16_t read_2_bytes(uint8_t code)
{
  uint16_t value;
  Wire.beginTransmission(ADDRESS_SENSOR);         // Start transmission to device 
  Wire.write(code);                               // Sends register address to read from
  Wire.endTransmission();                         // End transmission
  Wire.requestFrom(ADDRESS_SENSOR, 2);            // Request 2 bytes from device
  if(Wire.available() >= 2)
  {
    value = (Wire.read() << 8) | Wire.read();     // Get 2 bytes of data
  }
  return value;                                   // Return value
}

This is an output example:

Sensor calibration data:
AC1 = 7878
AC2 = -1089
AC3 = -14478
AC4 = 31607
AC5 = 24469
AC6 = 20562
B1 = 5498
B2 = 57
MB = -32768
MC = -11075
MD = 2432

Temperature: 23.50 C, 74.30 F
Pressure: 991.38 mbar, 29.28 inHg

Temperature: 23.50 C, 74.30 F
Pressure: 991.41 mbar, 29.28 inHg

Leo

I'm using your code and get this:

Sensor calibration data:
AC1 = 9060
AC2 = -1244
AC3 = -14867
AC4 = 33491
AC5 = 25092
AC6 = 15143
B1 = 6515
B2 = 52
MB = -32768
MC = -11786
MD = 2764

Temperature: 36.50 C, 97.70 F
Pressure: 1512.73 mbar, 1512.73 hPa, 44.67 inHg

Temperature: 36.50 C, 97.70 F
Pressure: 1512.73 mbar, 1512.73 hPa, 44.67 inHg

the temperature is ok (here is hoot right now), the pressure is, I guess, excessive since in my city we are at 10 ~ 30 meters over the sea; then the presure should be less around 1100.00 hPa, right? or can you tell me how to interpret this info.

Looks good to me.

You are looking at 1010.9 mbar for ca. 20 meters altitude.

Two options are available for compensation:

To measure pressure: Get the local pressure from your nearest weather station and use calculated pressure delta. To measure altitude: Use the known altitude at your location and use calculated altitude delta.

Of course I'm assuming the pressure sensor is functioning and the pressure readings change when you move the sensor up and down.

If you are reading 1500 mbar then your sensor is broken.

Can we help you with this problem in one thread, please ? Choose one, and post there.

michinyon: If you are reading 1500 mbar then your sensor is broken.

I have to agree with that conclusion. The reading is out of spec which I hadn't realized when I posted earlier.

Good call michinyon :)

this is other tread

I’ll update there all that topic about the over range measurement.
If you want to follow, thanks!
and thanks by the answers

well, I did it …

Sensor calibration data:
AC1 = 7583
AC2 = -1070
AC3 = -14723
AC4 = 33492
AC5 = 25032
AC6 = 15640
B1 = 6515
B2 = 38
MB = -32768
MC = -11786
MD = 2800

Temperature: 22.40 C, 72.32 F
Pressure: 1025.91 mbar, 30.30 inHg
:stuck_out_tongue_closed_eyes:

/**********************************************************
 Bosch Pressure Sensor BMP085 / BMP180 readout routine
 for the Arduino platform.
  
 Compiled by Leo Nutz
 www.ALTDuino.de              
**********************************************************/

#include <Wire.h>

#define ADDRESS_SENSOR 0x77                 // Sensor address

int16_t  ac1, ac2, ac3, b1, b2, mb, mc, md; // Store sensor PROM values from BMP180
uint16_t ac4, ac5, ac6;                     // Store sensor PROM values from BMP180
// Ultra Low Power       OSS = 0, OSD =  5ms
// Standard              OSS = 1, OSD =  8ms
// High                  OSS = 2, OSD = 14ms
// Ultra High Resolution OSS = 3, OSD = 26ms
const uint8_t oss = 3;                      // Set oversampling setting
const uint8_t osd = 26;                     // with corresponding oversampling delay 

float T, P;                                 // Set global variables for temperature and pressure 

void setup()
{
 Wire.begin();                             // Activate I2C
 
 Serial.begin(9600);                       // Set up serial port

 init_SENSOR();                            // Initialize baro sensor variables
 delay(100);
}

void loop()
{
 int32_t b5;

 b5 = temperature();                       // Read and calculate temperature (T) 

 Serial.print("Temperature: ");
 Serial.print(T, 2);
 Serial.print(" C, ");
 Serial.print(1.8 * T + 32.0, 2);
 Serial.println(" F");

 P = pressure(b5);                         // Read and calculate pressure (P) 

 Serial.print("Pressure: ");
 Serial.print(P, 2);
 Serial.print(" mbar, ");
 Serial.print(P * 0.0295299830714, 2);
 Serial.println(" inHg");
 Serial.println("");

 delay(500);                               // Delay between each readout
 
}

/**********************************************
 Initialize sensor variables
**********************************************/
void init_SENSOR()
{
 ac1 = read_2_bytes(0xAA);
 ac2 = read_2_bytes(0xAC);
 ac3 = read_2_bytes(0xAE);
 ac4 = read_2_bytes(0xB0);
 ac5 = read_2_bytes(0xB2);
 ac6 = read_2_bytes(0xB4);
 b1  = read_2_bytes(0xB6);
 b2  = read_2_bytes(0xB8);
 mb  = read_2_bytes(0xBA);
 mc  = read_2_bytes(0xBC);
 md  = read_2_bytes(0xBE);

 Serial.println("");
 Serial.println("Sensor calibration data:");
 Serial.print(F("AC1 = ")); Serial.println(ac1);
 Serial.print(F("AC2 = ")); Serial.println(ac2);
 Serial.print(F("AC3 = ")); Serial.println(ac3);
 Serial.print(F("AC4 = ")); Serial.println(ac4);
 Serial.print(F("AC5 = ")); Serial.println(ac5);
 Serial.print(F("AC6 = ")); Serial.println(ac6);
 Serial.print(F("B1 = "));  Serial.println(b1);
 Serial.print(F("B2 = "));  Serial.println(b2);
 Serial.print(F("MB = "));  Serial.println(mb);
 Serial.print(F("MC = "));  Serial.println(mc);
 Serial.print(F("MD = "));  Serial.println(md);
 Serial.println("");
}

/**********************************************
 Calcualte pressure readings
**********************************************/
float pressure(int32_t b5)
{
 int32_t x1, x2, x3, b3, b6, p, UP;
 uint32_t b4, b7; 

 UP = read_pressure();                         // Read raw pressure

 b6 = b5 - 4000;
 x1 = (b2 * (b6 * b6 >> 12)) >> 11; 
 x2 = ac2 * b6 >> 11;
 x3 = x1 + x2;
 b3 = (((ac1 * 4 + x3) << oss) + 2) >> 2;
 x1 = ac3 * b6 >> 13;
 x2 = (b1 * (b6 * b6 >> 12)) >> 16;
 x3 = ((x1 + x2) + 2) >> 2;
 b4 = (ac4 * (uint32_t)(x3 + 32768)) >> 15;
 b7 = ((uint32_t)UP - b3) * (50000 >> oss);
 if(b7 < 0x80000000) { p = (b7 << 1) / b4; } else { p = (b7 / b4) << 1; } // or p = b7 < 0x80000000 ? (b7 * 2) / b4 : (b7 / b4) * 2;
 x1 = (p >> 8) * (p >> 8);
 x1 = (x1 * 3038) >> 16;
 x2 = (-7357 * p) >> 16;
 return (p + ((x1 + x2 + 3791) >> 4)) / 100.0f; // Return pressure in mbar
}

/**********************************************
 Read uncompensated temperature
**********************************************/
int32_t temperature()
{
 int32_t x1, x2, b5, UT;

 Wire.beginTransmission(ADDRESS_SENSOR); // Start transmission to device 
 Wire.write(0xf4);                       // Sends register address
 Wire.write(0x2e);                       // Write data
 Wire.endTransmission();                 // End transmission
 delay(5);                               // Datasheet suggests 4.5 ms
 
 UT = read_2_bytes(0xf6);                // Read uncompensated TEMPERATURE value

 // Calculate true temperature
 x1 = (UT - (int32_t)ac6) * (int32_t)ac5 >> 15;
 x2 = ((int32_t)mc << 11) / (x1 + (int32_t)md);
 b5 = x1 + x2;
 T  = (b5 + 8) >> 4;
 T = T / 10.0;                           // Temperature in celsius 
 return b5;  
}

/**********************************************
 Read uncompensated pressure value
**********************************************/
int32_t read_pressure()
{
 int32_t value; 
 Wire.beginTransmission(ADDRESS_SENSOR);   // Start transmission to device 
 Wire.write(0xf4);                         // Sends register address to read from
 Wire.write(0x34 + (oss << 6));            // Write data
 Wire.endTransmission();                   // SEd transmission
 delay(osd);                               // Oversampling setting delay
 Wire.beginTransmission(ADDRESS_SENSOR);
 Wire.write(0xf6);                         // Register to read
 Wire.endTransmission();
 Wire.requestFrom(ADDRESS_SENSOR, 3);      // Request three bytes
 if(Wire.available() >= 3)
 {
   value = (((int32_t)Wire.read() << 16) | ((int32_t)Wire.read() << 8) | ((int32_t)Wire.read())) >> (8 - oss);
 }
 return value;                             // Return value
}

/**********************************************
 Read 1 byte from the BMP sensor
**********************************************/
uint8_t read_1_byte(uint8_t code)
{
 uint8_t value;
 Wire.beginTransmission(ADDRESS_SENSOR);         // Start transmission to device 
 Wire.write(code);                               // Sends register address to read from
 Wire.endTransmission();                         // End transmission
 Wire.requestFrom(ADDRESS_SENSOR, 1);            // Request data for 1 byte to be read
 if(Wire.available() >= 1)
 {
   value = Wire.read();                          // Get 1 byte of data
 }
 return value;                                   // Return value
}

/**********************************************
 Read 2 bytes from the BMP sensor
**********************************************/
uint16_t read_2_bytes(uint8_t code)
{
 uint16_t value;
 Wire.beginTransmission(ADDRESS_SENSOR);         // Start transmission to device 
 Wire.write(code);                               // Sends register address to read from
 Wire.endTransmission();                         // End transmission
 Wire.requestFrom(ADDRESS_SENSOR, 2);            // Request 2 bytes from device
 if(Wire.available() >= 2)
 {
   value = (Wire.read() << 8) | Wire.read();     // Get 2 bytes of data
 }
 return value;                                   // Return value
}

Hi, i,ve got this reading:

Sensor calibration data: AC1 = 0 AC2 = 0 AC3 = 0 AC4 = 0 AC5 = 0 AC6 = 0 B1 = 0 B2 = 0 MB = 0 MC = 0 MD = 0

Temperature: 0.00 C, 32.00 F Pressure: 2.35 mbar, 0.07 inHg