ADXL335 Class
- ID: adxl335
- Name: Low-power, 3-axis +/- 3 g Accelerometer
- Other Names: Grove 3-Axis Analog Accelerometer
- Category: accelerometer
- Manufacturer: seeed
- Connection: analog
- Link: http://www.analog.com/en/products/mems/accelerometers/adxl335.html
UPM module for the ADXL335 3-axis analog accelerometer. This was tested on a Grove 3-axis Analog Accelerometer. It uses 3 analog pins, one for each axis: X, Y, and Z.

Item Index
Methods
ADXL335
-
pinX -
pinY -
pinZ -
aref
ADXL335 constructor
Parameters:
-
pinXNumberAnalog pin to use for X-axis
-
pinYNumberAnalog pin to use for Y-axis
-
pinZNumberAnalog pin to use for Z-axis
-
arefNumberAnalog reference voltage; default is 5.0v
Returns:
setZeroX
-
zeroX
Sets the "zero" value of the X-axis, determined through calibration
Parameters:
-
zeroXNumber"Zero" value of the X-axis
setZeroY
-
zeroY
Sets the "zero" value of the Y-axis, determined through calibration
Parameters:
-
zeroYNumber"Zero" value of the Y-axis
setZeroZ
-
zeroZ
Sets the "zero" value of the Z-axis, determined through calibration
Parameters:
-
zeroZNumber"Zero" value of the Z-axis
values
-
xVal -
yVal -
zVal
Gets the analog values for the 3 axes
Parameters:
-
xValInt *Pointer to the returned X-axis value
-
yValInt *Pointer to the returned Y-axis value
-
zValInt *Pointer to the returned Z-axis value
values
()
Std::vector int
Gets the analog values for the 3 axes
Returns:
std::vector of x, y, z analog acceleration values
acceleration
-
xAccel -
yAccel -
zAccel
Gets the acceleration along all 3 axes
Parameters:
-
xAccelFloat *Pointer to returned X-axis value
-
yAccelFloat *Pointer to returned Y-axis value
-
zAccelFloat *Pointer to returned Z-axis value
acceleration
()
Std::vector float
Gets the acceleration along all 3 axes
Returns:
std::vector of x, y, z acceleration values
calibrate
()
While the sensor is still, measures the X-axis, Y-axis, and Z-axis values and uses those values as the zero values.