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]
Rating:
Author: MIKROE
Last Updated: 2020-11-03
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 2489 times
Not followed.
License: MIT license
Temp & Hum 14 Click is a compact add-on board that contains one of the smallest and most accurate humidity and temperature sensors on the market. This board features the HTU31D, a highly accurate digital relative humidity sensor with temperature output from TE Connectivity Measurement Specialties.
Do you want to subscribe in order to receive notifications regarding "Temp-Hum 14 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Temp-Hum 14 click" changes.
Do you want to report abuse regarding "Temp-Hum 14 click".
Library Description
The library covers all the necessary functions to control Temp&Hum 14 Click board™. Library performs a standard I2C interface communication.
Key functions:
void temphum14_set_conversion ( uint8_t hum_osr, uint8_t temp_osr )
- Set conversion function.void temphum14_get_diagnostic ( temphum14_diagn_t *diag_data )
- Get diagnostic status function.void temphum14_get_temp_and_hum ( float *temp, float *hum )
- Get temperature and humidity data function.Examples description
The application is composed of three sections :
void application_task ( )
{
temphum14_set_conversion( TEMPHUM14_CONVERSION_HUM_OSR_0_020,
TEMPHUM14_CONVERSION_TEMP_0_040 );
Delay_ms( 10 );
temphum14_get_temp_and_hum( &temperature, &humidity );
Delay_ms( 10 );
FloatToStr( temperature, log_text );
mikrobus_logWrite( " Temperature : ", _LOG_TEXT );
mikrobus_logWrite( log_text, _LOG_TEXT );
mikrobus_logWrite( " C", _LOG_LINE );
FloatToStr( humidity, log_text );
mikrobus_logWrite( " Humidity : ", _LOG_TEXT );
mikrobus_logWrite( log_text, _LOG_TEXT );
mikrobus_logWrite( " %", _LOG_LINE );
mikrobus_logWrite( "-----------------------------", _LOG_LINE );
Delay_ms( 3000 );
}
Additional Functions :
Other mikroE Libraries used in the example:
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.