Hi everyone again! You know that I developed a library to manage BMP180 for Teensy devices, I wrote this in previous article. After I developed the library, I uploaded it to GitHub and I sent a pull request to SparkFun. After a short time, they merged my library to their source code files, it is wonderful for me, it made me happy for a long time 🙂 So I decided to upgrade the library and I added this event to my calendar. Yesterday, I worked on this and it is ready now.

When the old version is used, BMP180 could be connected only SDA0 and SCL0 pins. It was work with only main i2c bus, alternate i2c buses can’t be used with the old library.

Now, with upgraded library; users can connect BMP180 to any i2c interfaces which they specify. Also, new library has two different type; “Wire” depending and “i2c_t3” depending. The example sketch is the same for both of them.

For example;

Teensy_BMP180 bmp180(&Wire);
//Teensy_BMP180 bmp180(&Wire1); //If BMP180 is connected to Wire1 bus
//Teensy_BMP180 bmp180(&Wire2); //If BMP180 is connected to Wire2 bus

Here is the output:

23.54 C | 918.10 mb | 0.34 cm
23.55 C | 918.10 mb | 0.29 cm
23.55 C | 918.06 mb | 0.66 cm
23.56 C | 918.11 mb | 0.24 cm
23.55 C | 918.10 mb | 0.36 cm
23.56 C | 918.08 mb | 0.52 cm
23.56 C | 918.11 mb | 0.21 cm
23.55 C | 918.09 mb | 0.42 cm
23.55 C | 918.03 mb | 0.92 cm
23.54 C | 918.07 mb | 0.61 cm
23.56 C | 918.08 mb | 0.54 cm

For more details: GITHUB