
A simple hello world for the FXLS8471Q using SPI mode
Diff: main.cpp
- Revision:
- 0:91ae2a9f7da6
--- /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