|
upm
0.3.1
Sensor/Actuator repository for libmraa (v0.7.2)
|
API for LSM303 Accelerometer & Compass. More...
This file defines the LSM303DLH 3-axis magnetometer/3-axis accelerometer. This module was tested with the SeedStudio Grove [6-Axis Accelerometer&Compass] module that is used over i2c. The magnometer and acceleromter are accessed at two seperate i2c addresses.
Public Member Functions | |
| LSM303 (int bus, int addrMag=LSM303_MAG, int addrAcc=LSM303_ACC, int accScale=8) | |
| ~LSM303 () | |
| float | getHeading () |
| mraa_result_t | getCoordinates () |
| mraa_result_t | getAcceleration () |
| int16_t * | getRawCoorData () |
| int16_t | getCoorX () |
| int16_t | getCoorY () |
| int16_t | getCoorZ () |
| int16_t * | getRawAccelData () |
| int16_t | getAccelX () |
| int16_t | getAccelY () |
| int16_t | getAccelZ () |
| LSM303 | ( | int | bus, |
| int | addrMag = LSM303_MAG, |
||
| int | addrAcc = LSM303_ACC, |
||
| int | accScale = 8 |
||
| ) |
Instanciates a LSM303 object
| i2c | bus |
| addr | magometer |
| addr | accelerometer |
| float getHeading | ( | ) |
Get Current Heading, headings <0 indicate an error occured

| mraa_result_t getCoordinates | ( | ) |
Get the coordinates in XYZ order

| mraa_result_t getAcceleration | ( | ) |
Get accelerometer values Call before calling other "get" functions for acceleration
| int16_t * getRawCoorData | ( | ) |
Get the raw coordinate data, this will get updated when getCoordinates() is called
| int16_t getCoorX | ( | ) |
Just get the X component of the coordinate data
| int16_t getCoorY | ( | ) |
Just get the Y component of the coordinate data
| int16_t getCoorZ | ( | ) |
Just get the Z component of the coordinate data
| int16_t * getRawAccelData | ( | ) |
Get the raw accelerometer data, this will get updated when getAcceleration() is called
| int16_t getAccelX | ( | ) |
Just get the X component of the acceleration
| int16_t getAccelY | ( | ) |
Just get the Y component of the acceleration
| int16_t getAccelZ | ( | ) |
Just get the Z component of the acceleration
1.8.9.1