A sample program to use MPL115A2 Library

Dependencies:   MPL115A2 mbed

Files at this revision

API Documentation at this revision

Comitter:
yamaguch
Date:
Sat May 14 17:32:01 2011 +0000
Commit message:
0.9

Changed in this revision

MPL115A2.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 2b7c3fd0488b MPL115A2.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MPL115A2.lib	Sat May 14 17:32:01 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/yamaguch/code/MPL115A2/#d77bd4340924
diff -r 000000000000 -r 2b7c3fd0488b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat May 14 17:32:01 2011 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "MPL115A2.h"
+
+MPL115A2 mpl115a2(p28, p27);
+
+int main() {
+    float pressure;
+    char data[16];
+
+    mpl115a2.read(&pressure, data);
+    printf("raw data:");
+    for (int i = 0; i < sizeof(data); i++) printf(" %02X", data[i]);
+    printf("\npressure = %4.0f hPa\n", pressure);
+    wait(1);
+    
+    while (true) {
+        printf("pressure = %4.0f hPa\n", mpl115a2.readPressure());
+        wait(1);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 2b7c3fd0488b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat May 14 17:32:01 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912