Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- JimCarver
- Date:
- 2014-04-19
- Revision:
- 0:230349f0612a
File content as of revision 0:230349f0612a:
#include "mbed.h"
#include "MMA8652.h"
MMA8652 acc( A4, A5);
Serial pc(USBTX, USBRX);
int main() {
float acc_data[3];
printf("\r\n\nMMA8652 Who Am I= %X\r\n", acc.getWhoAmI());
while (true) {
acc.ReadXYZ(acc_data);
printf("MMA8652 ACC: X=%1.4f Y=%1.4f Z=%1.4f\r\n\n", acc_data[0], acc_data[1], acc_data[2]);
wait(1.0);
}
}
NXP MMA8652 Accelerometer