Seed Barometer with I2C interface, NOT working with Seed Arch BLE. Need help.

Dependencies:   BMP085 mbed-src

Fork of Seeed_Barometer_Sensor_Example by Seeed

Committer:
grassel
Date:
Mon Nov 03 19:38:45 2014 +0000
Revision:
2:371c934ec950
Parent:
1:e15e9cb70711
Child:
4:fb3edb8a479c
bug fixed recommended at ; ; http://developer.mbed.org/questions/5107/Arch-BLE-I2C-working/#answer5381; ; still not working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sam_grove 0:8381ff08ace1 1
sam_grove 0:8381ff08ace1 2 #include "mbed.h"
sam_grove 0:8381ff08ace1 3 #include "BMP085.h"
sam_grove 0:8381ff08ace1 4
sam_grove 0:8381ff08ace1 5 int main(void)
sam_grove 0:8381ff08ace1 6 {
grassel 1:e15e9cb70711 7 printf("Creating i2c interface ...\r\n");
grassel 2:371c934ec950 8 I2C ic(p13, p15); // I2C (pin sda, pin slc)
grassel 1:e15e9cb70711 9 printf("Creating barometer interface ...\r\n");
grassel 1:e15e9cb70711 10 BMP085 barometer(ic, BMP085_oss1);
grassel 1:e15e9cb70711 11
sam_grove 0:8381ff08ace1 12 float p = 0.0f, t = 0.0f;
grassel 1:e15e9cb70711 13
grassel 1:e15e9cb70711 14 printf("Entering main loop ...\r\n");
sam_grove 0:8381ff08ace1 15 while(1) {
sam_grove 0:8381ff08ace1 16 barometer.update();
sam_grove 0:8381ff08ace1 17 p = barometer.get_pressure();
sam_grove 0:8381ff08ace1 18 t = barometer.get_temperature();
grassel 1:e15e9cb70711 19 printf("Pressure: %6.2f Temperature(c): %6.2f Temperature(F): %6.2f\r\n", p, t, 32 + t * 1.8f);
sam_grove 0:8381ff08ace1 20 wait(1.0f);
sam_grove 0:8381ff08ace1 21 }
sam_grove 0:8381ff08ace1 22 }