The BMP085 I have is an I2C device with seven pins, but only four, Vcc, Gnd, SCA and SCL are used (pins are in that order). I found a number of sketches but feel that the best was the one on the Adafruit site,
I made one small change, I wanted to plug the sensor straight into the Arduino, so I made A2 and A3 power pins. If you want to do the same insert the following code into the sketch at the start of the void setup() loop
digitalWrite(17, HIGH); // make this pin 5 volts
digitalWrite(16, LOW); // make this pin Gnd
Just a word of warning if you do this, make sure your board needs 5 volts not 3.3 volts to power it and also make sure your pinout matches mine!
The altitude is only correct if you know exactly what the pressure is at sea level as this sketch assumes it is 101500 pascals. Height is calculated by knowing the difference in pressure between your location and sea level.