UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

MMA7455 Class

Module: mma7455

This module defines the MMA7455 interface for libmma7455
mma7455.jpg

Methods

MMA7455

(
  • bus
  • devAddr
)
Number

Instantiates an MMA7455 object

Parameters:

  • bus Number

    Number of the used bus

  • devAddr Number

    Address of the used I2C device

Returns:

Number:

name

() String

Returns the name of the component

Returns:

String:

Name of the component

calibrate

() Mraa::Result

Calibrates the sensor

Returns:

Mraa::Result:

0 (MRAA_SUCCESS) if successful; non-zero otherwise

readData

(
  • ptrX
  • ptrY
  • ptrZ
)
Mraa::Result

Reads X-axis, Y-axis, and Z-axis acceleration data

Parameters:

  • ptrX Short *

    X-axis

  • ptrY Short *

    Y-axis

  • ptrZ Short *

    Z-axis

Returns:

Mraa::Result:

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 short :

std::vector containing X, Y, Z acceleration data

i2cReadReg

(
  • reg
  • buffer
  • len
)
Number

Internal function for reading I2C data

Parameters:

  • reg String

    Register address

  • buffer Uint8_t *

    Register data buffer

  • len Number

    Buffer size

Returns:

Number:

i2cWriteReg

(
  • reg
  • buffer
  • len
)
Mraa::Result

Internal function for writing I2C data

Parameters:

  • reg String

    Register address

  • buffer Uint8_t *

    Register data buffer

  • len Number

    Buffer size

Returns:

Mraa::Result: