Arduino_LPS22HB - readPressure()

Read the sensor’s measured 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 and KILOPASCAL to read the pressure in kilopascals. If unit parameter is not provided, default is kilopascals .

Returns

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

Examples

float pressure = BARO.readPressure();

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

See also