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.
Dependencies: MMA8451Q Motor mbed-rtos mbed
Fork of FRDM_MMA8451Q by
main.cpp
- Committer:
- emilmont
- Date:
- 2012-10-11
- Revision:
- 0:d9c1551e1fdc
- Child:
- 2:41db78380a6e
File content as of revision 0:d9c1551e1fdc:
#include "mbed.h"
#include "MMA8451Q.h"
#define MMA8451_I2C_ADDRESS (0x1d<<1)
int main(void) {
DigitalOut led(LED_GREEN);
MMA8451Q acc(P_E25, P_E24, MMA8451_I2C_ADDRESS);
printf("WHO AM I: 0x%2X\r\n", acc.getWhoAmI());
while (true) {
printf("-----------\r\n");
printf("acc_x: %d\r\n", acc.getAccX());
printf("acc_y: %d\r\n", acc.getAccY());
printf("acc_z: %d\r\n", acc.getAccZ());
wait(1);
led = !led;
}
}
