How to use =========== .. toctree:: :maxdepth: 3 :caption: Contents: Platform support ---------------- Framework: - Arduino This library is made to be used with: - ESP32 family Necessary inclusions -------------------- Only the header has to be included to you project .. code-block:: c++ #include "libMM_lps22hb.hpp" Object creation --------------- The library supports only SPI reading. The following example shows how to create the object: .. important:: API ref: :cpp:class:`LPS22HB_SPI` .. code-block:: c++ timerTool myTimer; SDIO_CONF sdioConf(generalConf.sdioClock, pinConf.pinSdioClk, pinConf.pinSdioCmd, pinConf.pinSdioDat0, pinConf.pinSdioDat1, pinConf.pinSdioDat2, pinConf.pinSdioDat3, generalConf.sdioMountpoint, false); streamLogger streamObj(&myTimer, sdioConf); LPS22HB_SPI lps(generalConf.lpsSpiClock, pinConf.pinLpsSS, false, &streamObj, &myTimer, &SPI, ABSTRACT_SENSOR_SPI::SPI_CONF()); Object configuration -------------------- The following example shows how to configure the sensor to use it: .. important:: API ref: :cpp:func:`LPS22HB_SPI::setOdr`, :cpp:func:`LPS22HB_SPI::setLowPassFilterState` .. code-block:: c++ :linenos: lps.begin(); lps.setOdr(LPS22HB_ENUM::ODR::_75HZ); delay(100); // lps.setLowPassFilterState(LPS22HB_ENUM::FILTER_BW::ODR_DIV_20); lps.configureReferenceParameters( ABSTRACT_BARO_ENUM::BARO_VALUES::INVALID_PRESSURE, ABSTRACT_BARO_ENUM::BARO_VALUES::DEFAULT_SEA_LEVEL_TEMPERATURE, ABSTRACT_BARO_ENUM::BARO_VALUES::INVALID_ALTITUDE); Get data -------- The following example shows how to get the data from the sensor: .. code-block:: c++ :linenos: ABSTRACT_BARO::BARO_OUTPUT resBARO; lps.readTemperaturePressureAltitude(); resBARO = lps.getOutput();