3-Axis Digital Accelerometer is the key part in projects like orientation detection, gesture detection and Motion detection. This 3-Asix Digital Accelerometer(±1.5g) is based on Freescale's low power consumption module, MMA7660FC. It features up to 10,000g high shock surviability and configurable Samples per Second rate. For generous applications that don't require too large measurement range, this is a great choice because it's durable, energy saving and cost-efficient.
Dependencies: Grove_3-Axis_Digital_Accelerometer_MMA7660FC_Library mbed
Fork of Seeed_Grove_3-Axis_Digital_Accelorometer_Example by
main.cpp
- Committer:
- mbedAustin
- Date:
- 2014-09-06
- Revision:
- 1:94e29063fb0d
- Parent:
- 0:6f0e33b2eb6e
File content as of revision 1:94e29063fb0d:
#include <mbed.h> #include "MMA7660.h" MMA7660 accelemeter; int main() { int8_t x, y, z; float ax,ay,az; accelemeter.init(); while(1){ accelemeter.getXYZ(&x,&y,&z); printf("X=%d, Y=%d, Z=%d, ",x,y,z); accelemeter.getAcceleration(&ax,&ay,&az); printf("Accleration of X=%2.2fg, Y=%2.2fg, Z=%2.2fg\n\r",ax,ay,az); wait(.5); } }