pyupm_lsm303dlh module

class pyupm_lsm303dlh.LSM303DLH(bus, addrMag=30, addrAcc=25, accScale=8)[source]

Bases: object

API for the LSM303DLH Accelerometer & Compass.

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.

C++ includes: lsm303dlh.hpp

LSM303DLH_ACC_T = 1
LSM303DLH_MAG_T = 0
getAccelX()[source]

int16_t getAccelX()

Gets the X component of the acceleration data

getAccelY()[source]

int16_t getAccelY()

Gets the Y component of the acceleration data

getAccelZ()[source]

int16_t getAccelZ()

Gets the Z component of the acceleration data

getAcceleration()[source]

mraa::Result getAcceleration()

Gets accelerometer values Should be called before other “get” functions for acceleration

getCoorX()[source]

int16_t getCoorX()

Gets the X component of the coordinates data

getCoorY()[source]

int16_t getCoorY()

Gets the Y component of the coordinates data

getCoorZ()[source]

int16_t getCoorZ()

Gets the Z component of the coordinates data

getCoordinates()[source]

mraa::Result getCoordinates()

Gets the coordinates in the XYZ order

getHeading()[source]

float getHeading()

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

float

getRawAccelData()[source]

int16_t * getRawAccelData()

Gets raw accelerometer data; it is updated when getAcceleration() is called

getRawCoorData()[source]

int16_t * getRawCoorData()

Gets raw coordinate data; it is updated when getCoordinates() is called

class pyupm_lsm303dlh.int16Array(nelements)[source]

Bases: object

cast()[source]
static frompointer()