Device::Accelerometer::LSM303DLHC - I2C interface to Accelerometer on the LSM303DLHC 3 axis magnetometer(compass) and accelerometer using Device::SMBus
version 0.011
Contains the I2CDevice Address for the bus on which your Accelerometer is connected. It would look like 0x6b. Default is 0x19.
This is a correction factor for converting raw values of acceleration in units of g or gravitational acceleration. It depends on the sensitivity set in the registers.
This is the acceleration due to gravity in meters per second square usually represented as g. default on earth is around 9.8 although it differs from 9.832 near the poles to 9.780 at equator. This might also be different if you are on a different planet or in space.
This attribute is built from the above two attributes automatically. This is usually gCorrectionFactor divided by gravitationalAcceleration. This is the inverse of relation between raw accelerometer values and its value in meters per seconds.
$self->enable()
Initializes the device, Call this before you start using the device. This function sets up the appropriate default registers. The Device will not work properly unless you call this function
$self->getRawReading()
Return raw readings from accelerometer registers
returns four acceleration vectors with accelerations in multiples of g - (9.8 meters per second square) note that even when stationary on the surface of earth(or a earth like planet) there is a acceleration vector g that applies perpendicular to the surface of the earth pointing opposite of the surface.
returns four acceleration vectors with accelerations in meters per second square note that even when stationary on the surface of earth(or a earth like planet) there is a acceleration vector g that applies perpendicular to the surface of the earth pointing opposite of the surface.
returns coordinate angles between the acceleration vector(R) and the cartesian Coordinates(x,y,z).
returns Roll and Pitch from the accelerometer. This is a bare reading from accelerometer and it assumes gravity is the only force on the accelerometer, which means it will be quiet inaccurate for a accelerating accelerometer.
placeholder for calibration function
Shantanu Bhadoria <shantanu at cpan dott org>
This software is copyright (c) 2013 by Shantanu Bhadoria.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Device::LSM303DLHC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::LSM303DLHC
CPAN shell
perl -MCPAN -e shell install Device::LSM303DLHC
For more information on module installation, please visit the detailed CPAN module installation guide.