#include "mbed.h" #include "MMA7660FC.h" #define ADDR_MMA7660 0x98MMA7660FC Acc(p28, p27, ADDR_MMA7660);
serial pc(USBTX, USBRX);
int x=0, y=0, z=0;
Acc.read_Tilt(&x, &y, &z);
pc.printf("Tilt x: %2.2f degree \n", x); // Print the tilt orientation of the X axis
pc.printf("Tilt y: %2.2f degree \n", y); // Print the tilt orientation of the Y axis
pc.printf("Tilt z: %2.2f degree \n", z); // Print the tilt orientation of the Z axis
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.