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

DimensionEngineering/ACCM3D2.h

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.
Each axis requires an ADC pin and so the device can be declared by specifying the X, Y and Z input pins. For example on the Axon this could be done as follows:-
#include "DimensionEngineering/ACCM3D2.h"
DE_ACCM3D2 accel = MAKE_DE_ACCM3D2(ADC0,ADC1,ADC2);
Having caused the sensor to be read using:-
accelerometerRead(accel);
Each axis can then be read independently:-
ACCEL_TYPE x = accel.accelerometer.x_axis_mG;
ACCEL_TYPE y = accel.accelerometer.y_axis_mG;
ACCEL_TYPE z = accel.accelerometer.z_axis_mG;
The values returned are in 'mG' ie 1000ths of the gravitational constant.

Valid XHTML 1.0 Transitional