thermo16 2.0.0.0
Main Page

Thermo 16 click

Thermo 16 Click is a Click board equipped with the sensor IC, which can measure temperature measurements between -40°C and +150°C so that the temperature measurement data can be processed by the host MCU.

click Product page


Click library

  • Author : Katarina Perendic
  • Date : okt 2019.
  • Type : ADC type

Software Support

We provide a library for the Thermo16 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 Thermo16 Click driver.

Standard key functions :

  • Config Object Initialization function.

    ‍void thermo16_cfg_setup ( thermo16_cfg_t *cfg );

    - Initialization function.

    ‍THERMO16_RETVAL thermo16_init ( thermo16_t *ctx, thermo16_cfg_t *cfg );

    Example key functions :

  • Temperature function.

    ‍float thermo16_get_temperature ( thermo16_t *ctx, uint8_t temp_format );

    - Generic read function.

    ‍thermo16_data_t thermo16_generic_read ( thermo16_t *ctx );

    Examples Description

‍ This demo-app shows the temperature measurement procedure using Thermo 16 click.

The demo application is composed of two sections :

Application Init

‍Configuring clicks and log objects.

void application_init ( void )
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
THERMO16_MAP_MIKROBUS( cfg, MIKROBUS_1 );
thermo16_init( &thermo16, &cfg );
}
#define THERMO16_MAP_MIKROBUS(cfg, mikrobus)
Definition thermo16.h:64
void thermo16_cfg_setup(thermo16_cfg_t *cfg)
Config Object Initialization function.
THERMO16_RETVAL thermo16_init(thermo16_t *ctx, thermo16_cfg_t *cfg)
Initialization function.
void application_init(void)
Definition main.c:34
Click configuration structure definition.
Definition thermo16.h:115

Application Task

‍Reads ambient temperature data and this data logs to USBUART every 1500ms.

void application_task ( void )
{
float temp;
// Task implementation.
log_printf( &logger, "** Temperature : %.2f C \r\n", temp );
Delay_ms ( 1000 );
Delay_ms ( 500 );
}
float thermo16_get_temperature(thermo16_t *ctx, uint8_t temp_format)
Temperature function.
#define THERMO16_TEMP_IN_CELSIUS
Definition thermo16.h:82
float temp
Definition main.c:30
void application_task(void)
Definition main.c:59

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Thermo16

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.