Device::Altimeter::LPS331AP - I2C interface to LPS331AP Altimeter using Device::SMBus
version 0.006
Contains the I2CDevice Address for the bus on which your altimeter is connected. It would look like 0x6b. Default is 0x5d.
$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
$self->getRawReading()
Return raw readings from registers
Get pressure in Millibars
Get pressure in inches of mercury
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);
Get Temperature in degrees celsius
Get Temperature in Fahrenheit
Placeholder for a calibration function
Shantanu Bhadoria <shantanu at cpan dott org>
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.
To install Device::LPS331AP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::LPS331AP
CPAN shell
perl -MCPAN -e shell install Device::LPS331AP
For more information on module installation, please visit the detailed CPAN module installation guide.