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

AnalogDevices/ADXL335.h

The ADXL335 is a 3 axis accelerometer from Analog Devices capable of measuring ±3g.
Data sheet: http://www.sparkfun.com/datasheets/Components/SMD/adxl335.pdf
Supplier: http://www.sparkfun.com/commerce/product_info.php?products_id=9268
This library assumes that the device is using the default 3 volt supply.
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 "AnalogDevices/ADXL335.h"
ADXL335 accel = MAKE_ADXL335(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