Example program for the BMP085.

Dependencies:   BMP085 mbed

Files at this revision

API Documentation at this revision

Comitter:
asmellby
Date:
Sun Nov 15 18:05:54 2015 +0000
Commit message:
Barometer example.;

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BMP085.lib	Sun Nov 15 18:05:54 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/silabs-abakurs/code/BMP085/#fb197da45ba8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Nov 15 18:05:54 2015 +0000
@@ -0,0 +1,22 @@
+#include "BMP085.h"
+
+LowPowerTicker ticker;
+
+bool do_measurement = false;
+void measurement() {
+    do_measurement = true;
+}
+
+int main() {
+    BMP085 sensor(PD6, PD7, BMP085_MODE_HIGH_RESOLUTION);
+    ticker.attach(&measurement, 0.4);    
+    
+    while(1) {
+        sleep();
+        if(do_measurement) {
+            do_measurement = false;
+            sensor.measure();
+            printf("T: %6.2f, P: %6.4f\r\n  ", sensor.get_temperature(), sensor.get_pressure());
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Nov 15 18:05:54 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file