You can find the Arduino library repository on github To install it, click this button to download the compressed ZIP file then install it. This guide will help you with the install process if you have never installed an Arduino library.
The same driver is used for both the BMP085 and BMP180!
Restart the IDE
Now you can run this first example sketch
#include "Wire.h" #include "Adafruit_BMP085.h" Adafruit_BMP085 bmp; void setup() { Serial.begin(9600); bmp.begin(); } void loop() { Serial.print("Temperature = "); Serial.print(bmp.readTemperature()); Serial.println(" *C"); Serial.print("Pressure = "); Serial.print(bmp.readPressure()); Serial.println(" Pa"); Serial.println(); delay(500); }
Altitude Measurements
Since we know that pressure drops as we gain altitude (that's why air is so thin on mountain-tops) we can compute the current altitude knowing the pressure and temperature. Again, there's a bit of hairy math involved, you can read about the calculations on wikipedia (where this graph is from).#include "Wire.h" #include "Adafruit_BMP085.h" Adafruit_BMP085 bmp; void setup() { Serial.begin(9600); bmp.begin(); } void loop() { Serial.print("Temperature = "); Serial.print(bmp.readTemperature()); Serial.println(" *C"); Serial.print("Pressure = "); Serial.print(bmp.readPressure()); Serial.println(" Pa"); // Calculate altitude assuming 'standard' barometric // pressure of 1013.25 millibar = 101325 Pascal Serial.print("Altitude = "); Serial.print(bmp.readAltitude()); Serial.println(" meters"); Serial.println(); delay(500); }