NAME

Device::LPS331AP::Altimeter - I2C interface to LPS331AP Altimeter using Device::SMBus

VERSION

version 0.001

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

CTRL_REG1 power: {0:off,1:on} ODR2:output data rate ODR1 ODR0 DIFF_EN: Interrupt generation{0:disabled,1:enabled} BDU: Block Data Update{0:continuous update, 1: output registers not updated until MSB and LSB reading} DELTA_EN: (1: delta pressure registers enabled. 0: disable) SIM: SPI Serial Interface Mode selection (0: 4-wire interface; 1: 3-wire interface) default = 1 111 0 1 1 0

getRawReading

$self->getRawReading()

Return raw readings from accelerometer registers

converts pressure in mbar to altitude in meters, using 1976 US Standard Atmosphere model (note that this formula only applies to a height of 11 km, or about 36000 ft) If altimeter setting (QNH, barometric pressure adjusted to sea level) is given, this function returns an indicated altitude compensated for actual regional pressure; otherwise, it returns the pressure altitude above the standard pressure level of 1013.25 mbar or 29.9213 inHg

QNH is the Barometric pressure adjusted to sea level for a particular region. This value helps altitude corrections based on base barometric pressure in your region.

(a-((x/b)^c))*d; d - (x^c)*(d/b^c);

AUTHOR

Shantanu Bhadoria <shantanu at cpan dott org>

COPYRIGHT AND LICENSE

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.