MMA7455 Class
- ID: mma7455
- Name: Three Axis +/- 2/4/8 g Digital Accelerometer
- Category: accelerometer
- Manufacturer: generic
- Connection: i2c
- Link: http://www.nxp.com/products/sensors/accelerometers/3-axis-accelerometers/2g-4g-8g-low-g-digital-accelerometer:MMA745xL
This module defines the MMA7455 interface for libmma7455
Item Index
Methods
MMA7455
-
bus
-
devAddr
Instantiates an MMA7455 object
Parameters:
-
bus
NumberNumber of the used bus
-
devAddr
NumberAddress of the used I2C device
Returns:
name
()
String
Returns the name of the component
Returns:
Name of the component
calibrate
()
Mraa::Result
Calibrates the sensor
Returns:
0 (MRAA_SUCCESS) if successful; non-zero otherwise
readData
-
ptrX
-
ptrY
-
ptrZ
Reads X-axis, Y-axis, and Z-axis acceleration data
Parameters:
-
ptrX
Short *X-axis
-
ptrY
Short *Y-axis
-
ptrZ
Short *Z-axis
Returns:
0 (MRAA_SUCCESS) if successful; non-zero otherwise
readData
()
Std::vector short
Reads X-axis, Y-axis, and Z-axis acceleration data
Returns:
std::vector containing X, Y, Z acceleration data
i2cReadReg
-
reg
-
buffer
-
len
Internal function for reading I2C data
Parameters:
-
reg
StringRegister address
-
buffer
Uint8_t *Register data buffer
-
len
NumberBuffer size
Returns:
i2cWriteReg
-
reg
-
buffer
-
len
Internal function for writing I2C data
Parameters:
-
reg
StringRegister address
-
buffer
Uint8_t *Register data buffer
-
len
NumberBuffer size