Jim Carver
/
Hello_FXLS8471Q
A simple hello world for the FXLS8471Q using SPI mode
Revision 0:91ae2a9f7da6, committed 2014-04-19
- Comitter:
- JimCarver
- Date:
- Sat Apr 19 16:44:55 2014 +0000
- Commit message:
- Hello World for FXLS8471Q
Changed in this revision
diff -r 000000000000 -r 91ae2a9f7da6 FXLS8471Q.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FXLS8471Q.lib Sat Apr 19 16:44:55 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/JimCarver/code/FXLS8471Q/#c80be04510fe
diff -r 000000000000 -r 91ae2a9f7da6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Apr 19 16:44:55 2014 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" +#include "FXLS8471Q.h" + +FXLS8471Q acc(D11, D12, D13, D10); +Serial pc(USBTX, USBRX); + + +int main() { +float acc_data[3]; + +printf("\r\n\nFXLS8471Q Who Am I= %X\r\n", acc.getWhoAmI()); + while (true) { + acc.ReadXYZ(acc_data); + printf("FXLS8471Q X=%1.4f Y=%1.4f Z=%1.4f\r\n", acc_data[0], acc_data[1], acc_data[2]); + wait(1.0); + } +} \ No newline at end of file
diff -r 000000000000 -r 91ae2a9f7da6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Apr 19 16:44:55 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e \ No newline at end of file