Parkavi Prabhaharan
/
pressurebyme
Calculates pressure with MPL115A1
Revision 0:b03929952ce3, committed 2013-11-07
- Comitter:
- Parkz
- Date:
- Thu Nov 07 14:12:03 2013 +0000
- Commit message:
- Program using the library MPL115A1
Changed in this revision
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