UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

BMPX8X Class

Module: bmpx8x

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.
bmp085.jpeg

Methods

BMPX8X

(
  • bus
  • addr
)
Number

Instantiates a BMPX8X object

Parameters:

  • bus Number

    I2C bus to use.

  • addr Number

    The I2C address of the device.

Returns:

Number:

update

()

Query the device and update the internal state. This method must be called before calling getPressure() , getTemperature() , getSealevelPressure() , and getAltitude() to retrieve values.

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.

init

(
  • oss
)

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.

Parameters:

  • oss BMPX8X_OSS_T

    One of the BMPX8X_OSS_T values. The default is BMPX8X_OSS_ULTRAHIGHRES.

setOversampling

(
  • oss
)

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.

Parameters:

  • oss BMPX8X_OSS_T

    One of the BMPX8X_OSS_T values. The default is BMPX8X_OSS_ULTRAHIGHRES.

getPressure

() Number

Returns the calculated pressure in Pascals. update() must have been called prior to calling this function.

Returns:

Number:

The pressure in Pascals.

getTemperature

() Number

Returns the calculated temperature in Celsius. update() must have been called prior to calling this function.

Returns:

Number:

The temperature in Celsius.

getSealevelPressure

(
  • meters
)
Number

Using the supplied altitude in meters, compute the pressure at sea level in Pascals. update() must have been called prior to calling this function.

Parameters:

  • meters Number

    The altitude in meters.

Returns:

Number:

The computed sea level pressure in Pascals.

getSealevelPressure

() Number

Using the current calculated altitude, compute the pressure at sea level in Pascals. update() must have been called prior to calling this function.

Returns:

Number:

The computed sea level pressure in Pascals.

getAltitude

(
  • sealevelPressure
)
Number

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.

Parameters:

  • sealevelPressure Number

    The pressure at sea level in Pascals. The default is 101325 Pascals.

Returns:

Number:

the computed altitude in meters.

getTemperatureCelsius

() Number

Return latest calculated temperature value in Celsius. See ITemperatureSensor .

Returns:

Number:

The current temperature in Celsius.

getPressurePa

() Number

Return latest calculated pressure value in Pascals. See IPressureSensor .

Returns:

Number:

The current pressure in Pascals.

getModuleName

() String

Returns the name of module.

Returns:

String:

The name of the module.