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.

Adxl345 Class

Module: adxl345

ADXL345 is a 3-axis digital accelerometer. ( http://www.seeedstudio.com/wiki/images/2/2c/ADXL345_datasheet.pdf ) The sensor has configurable resolutions to measure +/- 2g, +/- 4g, +/- 8g, or +/- 16g. Note: The Grove* version of the sensor is incompatible with and not detected on the I2C bus by the Intel(R) Edison using an Arduino* breakout board at 5V (3V works fine).
adxl345.jpeg

Methods

Adxl345

(
  • bus
)
Number

Creates an ADXL345 object

Parameters:

  • bus Number

    Number of the used I2C bus

Returns:

Number:

getAcceleration

() Float *

there is no need for a ADXL345 object destructor ~Adxl345(); Returns a pointer to a float[3] that contains acceleration (g) forces

Returns:

Float *:

float* to a float[3]

getRawValues

() Int16_t *

Returns a pointer to an int[3] that contains the raw register values for X, Y, and Z

Returns:

Int16_t *:

int* to an int[3]

getScale

() Number

Returns the scale the accelerometer is currently set up to: 2, 4, 8, or 16

Returns:

Number:

uint with the current scale value

update

() Mraa::Result

Updates the acceleration values from the I2C bus

Returns:

Mraa::Result:

0 if successful