barometer11 2.2.0
Loading...
Searching...
No Matches
barometer11


Barometer 11 Click

Barometer 11 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Filipovic
  • Date : Mar 2025.
  • Type : ADC/I2C type

Software Support

Example Description

This example demonstrates the use of the Barometer 11 Click board by initializing the device and reading the barometric pressure data in millibar units. The pressure value is periodically logged to the USB UART every second.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Barometer11

Example Key Functions

Application Init

Initializes the logger and the Barometer 11 Click driver.

void application_init ( void )
{
log_cfg_t log_cfg;
barometer11_cfg_t barometer11_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
barometer11_cfg_setup( &barometer11_cfg );
BAROMETER11_MAP_MIKROBUS( barometer11_cfg, MIKROBUS_1 );
err_t init_flag = barometer11_init( &barometer11, &barometer11_cfg );
if ( ( ADC_ERROR == init_flag ) || ( I2C_MASTER_ERROR == init_flag ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define BAROMETER11_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition barometer11.h:124
void application_init(void)
Definition main.c:29

Application Task

Reads and displays the pressure data every second.

void application_task ( void )
{
float pressure = 0;
if ( BAROMETER11_OK == barometer11_read_pressure ( &barometer11, &pressure ) )
{
log_printf( &logger, " Pressure : %.1f mBar\r\n\n", pressure );
Delay_ms ( 1000 );
}
}
@ BAROMETER11_OK
Definition barometer11.h:184
void application_task(void)
Definition main.c:60

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.