upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | List of all members

API for the ADXL335 3-Axis Analog Accelerometer. More...

Detailed Description

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.

adxl335.jpg

Public Member Functions

synchronized void delete ()
 
 ADXL335 (int pinX, int pinY, int pinZ, float aref)
 
 ADXL335 (int pinX, int pinY, int pinZ)
 
void setZeroX (float zeroX)
 
void setZeroY (float zeroY)
 
void setZeroZ (float zeroZ)
 
int[] values ()
 
float[] acceleration ()
 
void calibrate ()
 

Constructor & Destructor Documentation

ADXL335 ( int  pinX,
int  pinY,
int  pinZ,
float  aref 
)

ADXL335 constructor

Parameters
pinXAnalog pin to use for X-axis
pinYAnalog pin to use for Y-axis
pinZAnalog pin to use for Z-axis
arefAnalog reference voltage; default is 5.0v

Member Function Documentation

float [] acceleration ( )

Gets the acceleration along all 3 axes

Returns
Array containing acceleration on X, Y, Z axes
void calibrate ( )

While the sensor is still, measures the X-axis, Y-axis, and Z-axis values and uses those values as the zero values.

void setZeroX ( float  zeroX)

Sets the "zero" value of the X-axis, determined through calibration

Parameters
zeroX"Zero" value of the X-axis
void setZeroY ( float  zeroY)

Sets the "zero" value of the Y-axis, determined through calibration

Parameters
zeroY"Zero" value of the Y-axis
void setZeroZ ( float  zeroZ)

Sets the "zero" value of the Z-axis, determined through calibration

Parameters
zeroZ"Zero" value of the Z-axis
int [] values ( )

Gets the analog values for the 3 axes

Returns
Array containing value of X, Y, Z axes

The documentation for this class was generated from the following file: