This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

LPS22HB: Temperature and Pressure Monitor

Overview

This sample periodically reads pressure from the LPS22HB MEMS pressure sensor and displays it on the console.

Requirements

This sample uses the LPS22HB sensor controlled using the I2C interface.

References

Building and Running

This project outputs sensor data to the console. It requires an LPS22HB sensor, which is present on the disco_l475_iot1 board.

west build -b disco_l475_iot1 samples/sensor/lps22hb

Sample Output

Observation:1
Pressure:98.7 kPa
Temperature:22.5 C
Observation:2
Pressure:98.7 kPa
Temperature:22.5 C
Observation:3
Pressure:98.7 kPa
Temperature:22.5 C

<repeats endlessly every 2 seconds>