TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136724 times)
  2. FAT32 Library (69940 times)
  3. Network Ethernet Library (55940 times)
  4. USB Device Library (46265 times)
  5. Network WiFi Library (41886 times)
  6. FT800 Library (41169 times)
  7. GSM click (28982 times)
  8. PID Library (26412 times)
  9. mikroSDK (26358 times)
  10. microSD click (25363 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Barometer click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.15

mikroSDK Library: 2.0.0.0

Category: Pressure

Downloaded: 87 times

Not followed.

License: MIT license  

This application measures temperature and pressure data.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Barometer click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Barometer click" changes.

Do you want to report abuse regarding "Barometer click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


Barometer click

Barometer click carries the LPS25HB IC, which is a piezoresistive absolute pressure sensor with a measurement range from 260 to 1260 hPa.

barometer_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : Jan 2020.
  • Type : I2C/SPI type

Software Support

We provide a library for the Barometer Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Barometer Click driver.

Standard key functions :

  • Config Object Initialization function.

    void barometer_cfg_setup ( barometer_cfg_t *cfg );

  • Initialization function.

    BAROMETER_RETVAL barometer_init ( barometer_t ctx, barometer_cfg_t cfg );

  • Click Default Configuration function.

    void barometer_default_cfg ( barometer_t *ctx );

Example key functions :

  • Read temperature in degrees Celsius function

    float barometer_get_temperature_c ( barometer_t *ctx );

  • Read pressure in milibars function

    float barometer_get_pressure( barometer_t *ctx );

  • Check sensor status function

    uint8_t barometer_check_status ( barometer_t *ctx );

Examples Description

This application measures temperature and pressure data.

The demo application is composed of two sections :

Application Init

Initialization driver enable's - I2C, set default configuration and start write log.


void application_init ( void )
{
    log_cfg_t log_cfg;
    barometer_cfg_t cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    barometer_cfg_setup( &cfg );
    BAROMETER_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    barometer_init( &barometer, &cfg );

    barometer_default_cfg( &barometer );

    // Check sensor id
    if ( barometer_check_id( &barometer ) != BAROMETER_DEVICE_ID )
    {
        log_printf( &logger, "   ERROR  \r\n " );
    }
    else
    {
        log_printf( &logger, "   Initialization  \r\n" );
    }

    log_printf( &logger, "-------------------------------- \r\n" );
    Delay_100ms( );
}

Application Task

This is a example which demonstrates the use of Barometer Click board


void application_task ( void )
{
    float temperature_c;
    float pressure;

    temperature_c = barometer_get_temperature_c( &barometer );
    Delay_100ms( );

    pressure = barometer_get_pressure( &barometer );
    Delay_100ms( );

    log_printf( &logger, " Temperature : %.2f\r\n", temperature_c );

    log_printf( &logger, " Pressure    : %.2f\r\n", pressure );
    log_printf( &logger, "-------------------------------- \r\n" );

    Delay_1sec( );
}

ALSO FROM THIS AUTHOR

DAQ click

0

DAQ Click is a compact add-on board representing a data acquisition solution. This board features the ADAQ7768-1, a 24-bit precision data acquisition (DAQ) μModule system that encapsulates signal conditioning, conversion, and processing blocks into one SiP from Analog Devices. It supports a fully differential input signal with a maximum voltage range of ±12V with an excellent common-mode rejection ratio (CMRR). The input signal is fully buffered with a low input bias current, enabling the ADAQ7768-1 to interface to sensors with high output impedance directly.

[Learn More]

SPIRIT 2 click

0

SPIRIT 2 Click features the SP1ML-915, an ultra-low power, fully integrated RF module, which operates at 915 MHz ISM band. This Click board™ can be used to add wireless connectivity to any application, requiring no extensive RF communication experience. The module integrates all the required components, including the 32-bit STM32L1 MCU, a compact chip antenna, and accompanying circuitry. The SP1ML-915 module supports several types of modulation schemes, including 2-FSK, GFSK, GMSK, OOK, and ASK, allowing it to fulfill different RF transmission requirements.

[Learn More]

ADC 21 click

0

ADC 21 Click is a compact add-on board that converts an analog voltage into a digital representation. This board features the ADC1283, a low-power, eight-channel pure CMOS 12-bit analog-to-digital converter from STMicroelectronics. The ADC1283 is specified for conversion from 50ksps to 200ksps. Its architecture is based on a successive approximation register with an internal track-and-hold cell. It features eight single-ended multiplexed inputs, where the output serial data is straight binary and SPI-compatible.

[Learn More]