Reference   Language | Libraries | Comparison | Changes

Arduino_LPS22HB : BARO class

readPressure()

Description

Read the pressure value.

Syntax

BARO.readPressure()
BARO.readPressure(units)

Parameters

units

  • PSI to read the pressure in PSI (pounds per square inch),
  • MILLIBAR to read the pressure in millibars,
  • KILOPASCAL to read the pressure in kilopascals.
    Defaults to KILOPASCAL, if unit parameter is not provided

Returns

The pressure in PSI, millibar or kilopascal, depending on the units requested.

Example


  float pressure = BARO.readPressure();

  Serial.print("Pressure = ");
  Serial.print(pressure);
  Serial.println(" kPa");

See Also



Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.