NAME

Device::Magnetometer::LSM303DLHC - I2C interface to Magnetometer on the LSM303DLHC 3 axis magnetometer(compass) and accelerometer using Device::SMBus

VERSION

version 0.014

ATTRIBUTES

I2CDeviceAddress

Contains the I2CDevice Address for the bus on which your Magnetometer is connected. It would look like 0x6b. Default is 0x1e.

METHODS

enable

$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

getRawReading

$self->getRawReading()

Return raw readings from accelerometer registers

getMagnetometerScale1

$self->getMagnetometerScale1()

Return proper calculated readings from the magnetometer scaled between +0.5 and -0.5

REGISTERS

MR_REG_M

OUT_X_H_M

OUT_X_L_M

OUT_Y_H_M

OUT_Y_L_M

OUT_Z_H_M

OUT_Z_L_M

AUTHOR

Shantanu Bhadoria <shantanu at cpan dott org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 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.