Testé pour projet BTS SN

Dependencies:   MPL115A1 mbed

Fork of MPL115A1_HelloWorld by Christian Dupaty

Files at this revision

API Documentation at this revision

Comitter:
Parkz
Date:
Thu Nov 07 14:12:03 2013 +0000
Child:
1:3bdc0f29c3ae
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
--- /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);
+    }
+}
--- /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
--- /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