LSM303DLH Class
- ID: lsm303dlh
- Name: Triaxial Accelerometer/magnetometer
- Other Names: Grove 6-Axis Accelerometer & Compass
- Category: accelerometer compass
- Manufacturer: seeed adafruit stmicro
- Link: http://www.seeedstudio.com/wiki/Grove_-_6-Axis_Accelerometer%26Compass
- Connection: i2c
This module defines the LSM303DLHDLH 3-axis magnetometer/3-axis accelerometer. This module was tested with the Seeed Studio* Grove 6-Axis Accelerometer & Compass module used over I2C. The magnetometer and acceleromter are accessed at two seperate I2C addresses.
Item Index
Methods
Properties
Methods
LSM303DLH
-
bus
-
addrMag
-
addrAcc
-
accScale
Instantiates an LSM303DLH object
Parameters:
-
bus
NumberI2C bus to use
-
addrMag
NumberI2C address of the Magnetometer (default 0x1E)
-
addrAcc
NumberI2C address of the Accelerometer (default 0x19)
-
accScale
NumberAccelerometer scale, can be 2, 4 or 8 (default 8)
Returns:
getHeading
()
Number
LSM303DLH 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 ~LSM303DLH (); Gets the current heading; headings <0 indicate an error has occurred
Returns:
float
getCoordinates
()
Mraa::Result
Gets the coordinates in the XYZ order
Returns:
getAcceleration
()
Mraa::Result
Gets accelerometer values Should be called before other "get" functions for acceleration
Returns:
getRawCoorData
()
Int16_t *
Gets raw coordinate data; it is updated when getCoordinates() is called
Returns:
getCoorX
()
Number
Gets the X component of the coordinates data
Returns:
getCoorY
()
Number
Gets the Y component of the coordinates data
Returns:
getCoorZ
()
Number
Gets the Z component of the coordinates data
Returns:
getRawAccelData
()
Int16_t *
Gets raw accelerometer data; it is updated when getAcceleration() is called
Returns:
getAccelX
()
Number
Gets the X component of the acceleration data
Returns:
getAccelY
()
Number
Gets the Y component of the acceleration data
Returns:
getAccelZ
()
Number
Gets the Z component of the acceleration data