example usage of mpl115a2 library

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
joeh
Date:
Mon May 07 13:27:04 2012 +0000
Child:
1:f198c37d9f5a
Commit message:
beta version of mpl115a2 test program

Changed in this revision

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
mpl115a2.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 07 13:27:04 2012 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "MPL115A2.h"
+
+I2C i2c(p9, p10);        // sda, scl
+Serial pc(USBTX, USBRX); // tx, rx
+MPL115A2 p_sensor(&i2c, &pc);
+
+int main() {
+
+    p_sensor.begin();   
+    
+    while(1) 
+    {
+        p_sensor.ReadSensor();
+        pc.printf("Pressure    = %f\n", p_sensor.GetPressure());
+        wait(1);
+        pc.printf("Temperature = %f\n", p_sensor.GetTemperature());
+        wait(1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon May 07 13:27:04 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/737756e0b479
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpl115a2.lib	Mon May 07 13:27:04 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/joeh/code/mpl115a2/#6dbe3322f203