This program is an example of interfacing MMA7361 Breakout board with mbed with published library

Dependencies:   MMA7361L mbed

main.cpp

Committer:
Parkz
Date:
2013-10-11
Revision:
0:f930f6cb7cc9

File content as of revision 0:f930f6cb7cc9:

#include "mbed.h"
#include "MMA7361L.h"
MMA7361L acc(p15,p16,p17,p18);
Serial pc(USBTX,USBRX);
int main()
{
float x,y,z;
while(1)
{
acc.prepare();
x=acc.getAccelX();
y=acc.getAccelY();
z=acc.getAccelZ();
pc.printf("x=%f\ny=%f\nz=%f",x,y,z);
wait(2);
}
}