Hiroshi Yamaguchi
/
MPL115A2Sample
A sample program to use MPL115A2 Library
Revision 0:2b7c3fd0488b, committed 2011-05-14
- Comitter:
- yamaguch
- Date:
- Sat May 14 17:32:01 2011 +0000
- Commit message:
- 0.9
Changed in this revision
--- /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
--- /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
--- /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