A simple hello world for the FXLS8471Q using SPI mode

Dependencies:   FXLS8471Q mbed

main.cpp

Committer:
JimCarver
Date:
2014-04-19
Revision:
0:91ae2a9f7da6

File content as of revision 0:91ae2a9f7da6:

#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);
    }
}