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:
-
pinX
NumberAnalog pin to use for X-axis
-
pinY
NumberAnalog pin to use for Y-axis
-
pinZ
NumberAnalog pin to use for Z-axis
-
aref
NumberAnalog reference voltage; default is 5.0v
Returns:
setZeroX
-
zeroX
Sets the "zero" value of the X-axis, determined through calibration
Parameters:
-
zeroX
Number"Zero" value of the X-axis
setZeroY
-
zeroY
Sets the "zero" value of the Y-axis, determined through calibration
Parameters:
-
zeroY
Number"Zero" value of the Y-axis
setZeroZ
-
zeroZ
Sets the "zero" value of the Z-axis, determined through calibration
Parameters:
-
zeroZ
Number"Zero" value of the Z-axis
values
-
xVal
-
yVal
-
zVal
Gets the analog values for the 3 axes
Parameters:
-
xVal
Int *Pointer to the returned X-axis value
-
yVal
Int *Pointer to the returned Y-axis value
-
zVal
Int *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:
-
xAccel
Float *Pointer to returned X-axis value
-
yAccel
Float *Pointer to returned Y-axis value
-
zAccel
Float *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.