upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
API for the ADXL345 3-Axis Digital Accelerometer. More...
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).
Public Member Functions | |
Adxl345 (int bus) | |
float * | getAcceleration () |
int16_t * | getRawValues () |
uint8_t | getScale () |
mraa::Result | update () |
Adxl345 | ( | int | bus | ) |
Creates an ADXL345 object
bus | Number of the used I2C bus |
float * getAcceleration | ( | ) |
there is no need for a ADXL345 object destructor ~Adxl345(); Returns a pointer to a float[3] that contains acceleration (g) forces
int16_t * getRawValues | ( | ) |
Returns a pointer to an int[3] that contains the raw register values for X, Y, and Z
uint8_t getScale | ( | ) |
Returns the scale the accelerometer is currently set up to: 2, 4, 8, or 16
mraa::Result update | ( | void | ) |
Updates the acceleration values from the I2C bus