this class is meant to deal with the Freescale MMA7455L accelermoter through an SPI interface. it has limtid functionality, but it can be extended to contain more features

Dependencies:   mbed

main.cpp

Committer:
hassan_ali
Date:
2012-02-05
Revision:
0:0d4a1401a9c5

File content as of revision 0:0d4a1401a9c5:

#include "mbed.h"
#include "MMA7455L_SPI.h"
DigitalOut myled(LED1);
Serial pc(USBTX, USBRX);
MMA7455L_SPI acc(p5,p6,p7,p14);
int main() {
    while(1) {
        acc.update_acceleration();
        pc.printf("%f %5.3f %5.3f\r\n", acc.Ax, acc.Ay, acc.Az);
        myled = 1;
        wait(0.02);
        myled = 0;
        wait(0.02);
    }
}