How can I add 2 pressure sensors BMP180 to Arduino Uno?

mymyball:
Hello there :). Same problem here.
I also need to hook up two BMP180-sensors to a Uno.
First I tried the SoftI2cMaster library. But I couldn't get I to work. So after a lot of frustration I wrote my own I2C library specially for BMP180. It can properly also be used for some other sensors too.
It supports an infinite number of I2C-connections (as long as you have enough pins on your board).

I have attached an example .ino which reads two BMP180-sensors. It can be easily modified to more sensors.
I have also attached the library.h and .cpp which should be put in your library folder.

There is almost no comments in the code since I am a lazy bastard, wrote it for my self and only puts it up here as a kind gesture.

BTW: If the sensor is located on a breakoutboard, it has pull-up-resistors built in.

Hope it helps dude. 8)

Nothing short of genius!
I noticed a bug in the code (a cast from int16_t to int32_t was forgotten).
This is the correct line:
b3 = ((((int32_t)ac1[sensnr] * 4 + x3) << oss) + 2) >> 2; // cast was forgotten!!

Hello, i want to ask.
Can i connect 2 bmp180 and 1 lcd i2c on one arduino?
if i can how to do it?

Many thanks to original poster and creator mymyball. I have changed it a little and fixed the bug noted by ggerber above. It works with a larger number of BMP180 sensors. I tested it successfully with 4 on a arduino pro min at 3.3V @8Mhz.

BMP180X4.zip (4.76 KB)