Reference   Language | Libraries | Comparison | Changes

Arduino_MKRENV : ENV class

readPressure

Description

Read the sensor’s pressure value. If no unit is specified, the value is expressed in kilopascal.

Syntax

ENV.readPressure(unit)

Parameters

PSI - the value returned is a float and uses Pound per Square Inch as unit.
MILLIBAR - the value returned is a float and uses millibar as unit.
KILOPASCAL - the value returned is a float and uses kilopascal as unit (default).

Returns

The pressure value expressed in the unit selected. If no unit is specified, the default value is kilopascal.

Example


Serial.print("Pressure    = ");
Serial.print(ENV.readPressure());
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.