Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
Frederic Pillon edited this pageMay 28, 2024 ·2 revisions

LPS22HB

Arduino library to support the LPS22HB 260-1260 hPa absolute digital output barometer.

API

  • LPS22HBSensor(TwoWire*, uint8_t): class constructor
    Params pointer to the I2C instance
    Params (optional) address of the component's instance

  • Enable: enable sensor
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

  • Disable: disable sensor
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

  • ReadID(uint8_t*): read ID address
    Params pointer where store the ID of the device
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

  • Reset: reboot memory content
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

  • GetPressure(float*): read output register and calculate the pressure in mbarParams pointer where to store data
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

  • GetTemperature(float*): read output register and calculate the temperatureParams pointer where to store data
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

  • GetODR(float*): get the output data rate mode
    Params pointer where to store data
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

  • SetODR(float): set the output data rate mode
    Params data rate to be set
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

  • ReadReg(uint8_t, uint8_t*): read data from register
    Params register address
    Params pointer to register data
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

  • WriteReg(uint8_t, uint8_t): write data to register
    Params register address
    Params register data
    Returns LPS22HB_STATUS_OK in case of success, an error code otherwise

Note

This library uses the Wire library presents in the STM32 core by default.

Examples

  • DISCO_IOT_LPS22HB_DataLog_Terminal: reads pressure and temperature values and prints them.

Source

You can find the source files at
https://github.com/stm32duino/LPS22HB

Documentation

The LPS22HB datasheet is available at
http://www.st.com/content/st_com/en/products/mems-and-sensors/pressure-sensors/lps22hb.html

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp