Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# ArduinoLPS22HB library

## Methods

### `begin()`

Initialize the pressure sensor.

#### Syntax

```
BARO.begin()
```

#### Parameters

None.

#### Returns

1 on success, 0 on failure.

#### Example

```
if (!BARO.begin()) {
Serial.println("Failed to initialize pressure sensor!");
while (1);
}
```

#### See also

* [end()](#end)
* [readPressure()](#readPressure)

### `end()`

De-initialize the pressure sensor.

#### Syntax

```
BARO.end()
```

#### Parameters

None.

#### Returns

None.

#### Example

```
if (!BARO.begin()) {
Serial.println("Failed to initialize pressure sensor!");
while (1);
}

// ...

BARO.end();
```

#### See also

* [begin()](#begin)
* [readPressure()](#readPressure)

### `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 `KILOPASCALS` 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

* [begin()](#begin)
* [end()](#end)
15 changes: 15 additions & 0 deletions docs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ArduinoLPS22HB library


The ArduinoLPS22HB library allows you to use the LPS22HB sensor available on the Arduino® Nano 33 BLE Sense board to read the air pressure.

To use this library:

```
#include <Arduino_LPS22HB.h>
```

Main features of the HTS221 sensor:

- Absolute pressure range: 260 to 1260 hPa.