Guido Grassel / Mbed 2 deprecated Seed_Barometer_Sensor_custom_I2C_lib

Dependencies:   BMP085 I2CX mbed

Files at this revision

API Documentation at this revision

Comitter:
grassel
Date:
Tue Nov 04 19:20:42 2014 +0000
Child:
1:b5fc2fd3546b
Commit message:
working, see http://developer.mbed.org/questions/5107/Arch-BLE-I2C-working/#answer5383 esp the answer by Joris Aerts

Changed in this revision

BMP085.lib Show annotated file Show diff for this revision Revisions of this file
I2CX.lib Show annotated file Show diff for this revision Revisions of this file
man.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BMP085.lib	Tue Nov 04 19:20:42 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/okini3939/code/BMP085/#61eea911ad24
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/I2CX.lib	Tue Nov 04 19:20:42 2014 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/jaerts/code/I2CX/#9d9fc94594e3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man.cpp	Tue Nov 04 19:20:42 2014 +0000
@@ -0,0 +1,26 @@
+
+#include "mbed.h"
+#include "I2CX.h"
+#include "BMP085.h"
+
+// this little program onlu works with the modified mbed-src, 
+// see https://developer.mbed.org/questions/5107/Arch-BLE-I2C-working/#answer5390
+
+int main(void)
+{
+    printf("Creating i2c interface  ...\r\n");
+    I2CX ic(I2C_0, p29, p28); // I2CName peripheral, pin sda, pin slc)
+    printf("Creating barometer interface  ...\r\n");
+    BMP085 barometer(ic, BMP085_oss1);
+
+    float p = 0.0f, t = 0.0f;
+
+    printf("Entering main loop  ...\r\n");
+    while(1) {
+        barometer.update();
+        p = barometer.get_pressure();
+        t = barometer.get_temperature();
+        printf("Pressure: %6.2f Temperature(c): %6.2f Temperature(F): %6.2f\r\n", p, t, 32 + t * 1.8f);
+        wait(1.0f);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Nov 04 19:20:42 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file