Example using barometer

Dependencies:   BMP085 mbed

Files at this revision

API Documentation at this revision

Comitter:
sam_grove
Date:
Sat Aug 16 01:03:36 2014 +0000
Commit message:
Initial commit

Changed in this revision

BMP085.lib Show annotated file Show diff for this revision Revisions of this file
main.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
diff -r 000000000000 -r 8381ff08ace1 BMP085.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BMP085.lib	Sat Aug 16 01:03:36 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/okini3939/code/BMP085/#5e2b1f3c0a6a
diff -r 000000000000 -r 8381ff08ace1 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Aug 16 01:03:36 2014 +0000
@@ -0,0 +1,18 @@
+
+#include "mbed.h"
+#include "BMP085.h"
+
+BMP085 barometer(D14, D15);
+
+int main(void)
+{
+    float p = 0.0f, t = 0.0f;
+ 
+    while(1) {
+        barometer.update();
+        p = barometer.get_pressure();
+        t = barometer.get_temperature();
+        printf("Pressure: %6.2f Temperature(c): %6.2f Temperature(F): %6.2f\n", p, t, 32 + t * 1.8f);
+        wait(1.0f);
+    }
+}
diff -r 000000000000 -r 8381ff08ace1 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Aug 16 01:03:36 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file