MMA8X5X Class
- ID: mma8x5x
- Name: MMA8X5X Three-Axis Accelerometer
- Other Chips: mma8451 mma8452 mma8453 mma8652 mma8653
- Category: accelerometer compass
- Manufacturer: freescale
- Link: http://www.nxp.com/products/sensors/accelerometers:DRSNSAXLRTN
- Connection: i2c
Description in web-link above: The NXP MMA8X5X are low-power, three-axis capacitive micromachined accelerometer with 10/12/14 bits of resolution. These accelerometer are packed with embedded functions with flexible user-programmable options configurable to two interrupt pins. The MMA8X5X have user-selectable full scales of +-2g/+-4g/+-8g.
Item Index
Methods
MMA8X5X
-
bus
-
params
-
devAddr
Instantiates an MMA8X5X object
Parameters:
-
bus
NumberNumber of the used bus params Params of device
-
params
Mma8x5x_params_tundefined
-
devAddr
NumberAddress of the used I2C device
Returns:
setDeviceName
-
type
Set device name and type matching given type or read out devive_id to set name and type of device
Parameters:
-
type
NumberType of device if set or 0 if needed to find out by it
Returns:
0 on success -1 on error
setDeviceParams
-
params
Set device params to given data or set default params and read out devive_id to set type of device
Parameters:
-
params
Mma8x5x_params_tParams of device if set by user NULL if it is not set by user
Returns:
0 on success -1 on error
setUserOffset
-
x
-
y
-
z
Set user offset correction Offset correction register will be erased after accelerometer reset
Parameters:
-
x
NumberOffset correction value for x-axis
-
y
NumberOffset correction value for y-axis
-
z
NumberOffset correction value for z-axis
Returns:
0 on success -1 on error
setActive
()
Number
Set active mode, this enables periodic measurements
Returns:
0 on success -1 on error
setStandby
()
Number
Set standby mode, this disables periodic measurements
Returns:
0 on success -1 on error
isReady
()
Number
Check for new set of measurement data.
Returns:
MMA8X5X_DATA_READY if new sample is ready MMA8X5X_NODATA if nothing is available
sampleData
()
Number
Read & calculate accelerometer data in mg & saves them to variables
Returns:
0 on success -1 on error
getX
-
bSampleData
Get x-axis acceleration
Parameters:
-
bSampleData
NumberFlag to read sensor
Returns:
The x-axis acceleration on success -999 on error
getY
-
bSampleData
Get y-axis acceleration
Parameters:
-
bSampleData
NumberFlag to read sensor
Returns:
The y-axis acceleration on success -999 on error
getZ
-
bSampleData
Get z-axis acceleration
Parameters:
-
bSampleData
NumberFlag to read sensor
Returns:
The z-axis acceleration on success -999 on error
getData
-
data
-
bSampleData
Get sensor values
Parameters:
-
data
Mma8x5x_data_tSensor values
-
bSampleData
NumberFlag to read sensor
Returns:
0 on success -1 on error