WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

ACCM3D2 3axis

The ACCM3D2 is a 3 axis accelerometer from Dimension Engineering. See http://www.dimensionengineering.com/DE-ACCM3D2.htm
DE-ACCM3Dbig.jpg
de-accm3d2.jpg
This library assumes that the device is being powered by a 3.5V to 15V supply via the on-board 3.3V regulator.
Example
Assuming you have called the device 'myAccel' in Project Designer then add the following code to your 'appControl' function:-
// Read the accelerometer and store results
myAccel.read();
 
// Retrieve the x axis value in mG
ACCEL_TYPE x = myAccel.getX();
// Retrieve the x axis value in mG
ACCEL_TYPE y = myAccel.getY();
// Retrieve the x axis value in mG
ACCEL_TYPE z = myAccel.getZ();
 
// Each value can be printed to stdout:
cout << "X=" << x << " Y=" << y << " Z=" << z;
 
// or all values can be dumped to stdout out using
cout << myAccel;
The values returned are in 'mG' ie 1000ths of the gravitational constant.
Function Summary

Valid XHTML 1.0 Transitional