Calculates pressure with MPL115A1

Dependencies:   mbed mpl115a1

Files at this revision

API Documentation at this revision

Comitter:
Parkz
Date:
Thu Nov 07 14:12:03 2013 +0000
Commit message:
Program using the library MPL115A1

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
mpl115a1.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r b03929952ce3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 07 14:12:03 2013 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "mpl115a1.h"
+Serial pc(USBTX,USBRX);
+int main() {
+// Chip must be deselected
+    cs = 1;
+ 
+    // Setup the spi for 8 bit data, high steady state clock,
+    // second edge capture, with a 8MHz clock rate
+    spi.format(8,0);
+    spi.frequency(8000000);
+//Chip selscted
+cs=0;
+    while(1) {
+        float pressure_pKa = 0;
+        sdn=1;
+        wait(0.02);
+        pressure_pKa = calculatePressurekPa();
+        pc.printf("Pressure=%d",pressure_pKa);
+        sdn=0;
+        wait(5);
+    }
+}
diff -r 000000000000 -r b03929952ce3 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 07 14:12:03 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file
diff -r 000000000000 -r b03929952ce3 mpl115a1.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpl115a1.lib	Thu Nov 07 14:12:03 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Parkz/code/mpl115a1/#89572af84e82