pyupm_bmpx8x module¶
-
class
pyupm_bmpx8x.
BMPX8X
(bus=0, addr=119)[source]¶ Bases:
pyupm_bmpx8x.IPressureSensor
,pyupm_bmpx8x.ITemperatureSensor
API for the GY65/BMP085 and BMP180 Atmospheric Pressure Sensors.
ID: bmpx8x
Name: BMP Atmospheric Pressure Sensor
Other Names: GY65 BMP085 BMP180 BMP183
Category: pressure
Manufacturer: bosch seeed adafruit sparkfun
Connection: i2c
Link:https://www.sparkfun.com/datasheets/Components/General/BST- BMP085-DS000-05.pdf
Link:https://www.bosch-sensortec.com/bst/products/all_products/bmp180
Link:https://cdn-shop.adafruit.com/datasheets/1900_BMP183.pdf Bosch GY65/BMP085 and BMP180 are high-precision, ultra-low power consumption pressure sensors. They operate in the range of 30,000-110,000 Pa.
This module has been tested on the GY65/BMP085 and BMP180 sensors.
C++ includes: bmpx8x.hpp
-
getAltitude
(sealevelPressure=101325)[source]¶ float getAltitude(int sealevelPressure=101325)
Calculate the current altitude in meters, given a sea level pressure in Pascals. The default sea level pressure is 101325 Pascals. update() must have been called prior to calling this function.
sealevelPressure: The pressure at sea level in Pascals. The default is 101325 Pascals.
the computed altitude in meters.
-
getModuleName
()[source]¶ const char* getModuleName()
Returns the name of module.
The name of the module.
-
getPressure
()[source]¶ int getPressure()
Returns the calculated pressure in Pascals. update() must have been called prior to calling this function.
The pressure in Pascals.
-
getPressurePa
()[source]¶ int getPressurePa()
Return latest calculated pressure value in Pascals. See IPressureSensor.
The current pressure in Pascals.
-
getSealevelPressure
(*args)[source]¶ int getSealevelPressure()
Using the current calculated altitude, compute the pressure at sea level in Pascals. update() must have been called prior to calling this function.
The computed sea level pressure in Pascals.
-
getTemperature
()[source]¶ float getTemperature()
Returns the calculated temperature in Celsius. update() must have been called prior to calling this function.
The temperature in Celsius.
-
getTemperatureCelsius
()[source]¶ int getTemperatureCelsius()
Return latest calculated temperature value in Celsius. See ITemperatureSensor.
The current temperature in Celsius.
-
init
(oss=3)[source]¶ void init(BMPX8X_OSS_T oss=BMPX8X_OSS_ULTRAHIGHRES)
Initialize the device, read calibration data, and start operation. This function is called from the constructor, so it will not typically need to be called by a user unless the device is reset.
oss: One of the BMPX8X_OSS_T values. The default is BMPX8X_OSS_ULTRAHIGHRES.
std::runtime_error: on failure.
-
reset
()[source]¶ void reset()
Reset the device to power-on defaults. All calibration data is lost when the device is reset, so you should call init() before attempting to use the device.
std::runtime_error: on failure.
-
setOversampling
(oss=3)[source]¶ void setOversampling(BMPX8X_OSS_T oss=BMPX8X_OSS_ULTRAHIGHRES)
Set the oversampling (precision mode) of the device. Higher precision requires more time to complete. This call takes effect the next time update() is called.
oss: One of the BMPX8X_OSS_T values. The default is BMPX8X_OSS_ULTRAHIGHRES.
-
-
class
pyupm_bmpx8x.
IPressureSensor
(*args, **kwargs)[source]¶ Bases:
pyupm_bmpx8x.IModuleStatus
-
class
pyupm_bmpx8x.
ITemperatureSensor
(*args, **kwargs)[source]¶ Bases:
pyupm_bmpx8x.IModuleStatus
Interface for Temperature Sensors.
C++ includes: iTemperatureSensor.hpp