upm
0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
|
API for the LSM303 Accelerometer & Compass. More...
This module defines the LSM303DLH 3-axis magnetometer/3-axis accelerometer. This module was tested with the Seeed Studio* Grove 6-Axis Accelerometer & Compass module used over I2C. The magnometer and acceleromter are accessed at two seperate I2C addresses.
Public Member Functions | |
synchronized void | delete () |
LSM303 (int bus, int addrMag, int addrAcc, int accScale) | |
LSM303 (int bus, int addrMag, int addrAcc) | |
LSM303 (int bus, int addrMag) | |
LSM303 (int bus) | |
float | getHeading () |
int | getCoordinates () |
int | getAcceleration () |
short[] | getRawCoorData () |
short | getCoorX () |
short | getCoorY () |
short | getCoorZ () |
short[] | getRawAccelData () |
short | getAccelX () |
short | getAccelY () |
short | getAccelZ () |
LSM303 | ( | int | bus, |
int | addrMag, | ||
int | addrAcc, | ||
int | accScale | ||
) |
Instantiates an LSM303 object
i2c | bus |
addr | Magnetometer |
addr | Accelerometer |
int getAcceleration | ( | ) |
Gets accelerometer values Should be called before other "get" functions for acceleration
short getAccelX | ( | ) |
Gets the X component of the acceleration data
short getAccelY | ( | ) |
Gets the Y component of the acceleration data
short getAccelZ | ( | ) |
Gets the Z component of the acceleration data
int getCoordinates | ( | ) |
Gets the coordinates in the XYZ order
short getCoorX | ( | ) |
Gets the X component of the coordinates data
short getCoorY | ( | ) |
Gets the Y component of the coordinates data
short getCoorZ | ( | ) |
Gets the Z component of the coordinates data
float getHeading | ( | ) |
LSM303 object destructor where is no more need for this here - I2c connection will be stopped automatically when m_i2c variable will go out of scope ~LSM303 (); Gets the current heading; headings <0 indicate an error has occurred
short [] getRawAccelData | ( | ) |
Gets raw accelerometer data; it is updated when getAcceleration() is called
short [] getRawCoorData | ( | ) |
Gets raw coordinate data; it is updated when getCoordinates() is called