NAME
Device::Altimeter::LPS331AP - I2C interface to LPS331AP Altimeter using Device::SMBus
VERSION
version 0.006
ATTRIBUTES
I2CDeviceAddress
Contains the I2CDevice Address for the bus on which your altimeter is connected. It would look like 0x6b. Default is 0x5d.
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 registers
getPressureMillibars
Get pressure in Millibars
getPressureInchesHg
Get pressure in inches of mercury
getPressureToAltitudeMeters
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);
getTemperatureCelsius
Get Temperature in degrees celsius
getTemperatureFahrenheit
Get Temperature in Fahrenheit
calibrate
Placeholder for a calibration function
REGISTERS
CTRL_REG1
PRESS_OUT_H
PRESS_OUT_L
PRESS_OUT_XL
TEMP_OUT_H
TEMP_OUT_L
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.