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: 2019-07-02
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 3396 times
Not followed.
License: MIT license
Temp&Hum 13 Click is a Click board which is perfectly suited for measuring the relative humidity (RH) and temperature. The Click boardâ„¢ is equipped with the HTU21DF, an accurate and reliable sensor IC, packed in a miniature 3x3mm DFN package.
Do you want to subscribe in order to receive notifications regarding "Temp-Hum 13 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Temp-Hum 13 click" changes.
Do you want to report abuse regarding "Temp-Hum 13 click".
Library Description
Library contains functions for getting temperature and humidity. Library contains functions for getting and setting user register. Library contains functions for changing resolution and soft reset. Library contains functions for enabling/disabling heater and OTP.
Key functions:
float temphum13_getTemperature(void)
- This function issues hold temperature measurement command, calculates CRC for temperature value, compares two CRC values and calculates temperature value.float temphum13_getHumidity(void)
- This function issues hold humidity measurement, calculates CRC for humidity value, compares two CRC values and calculates humidity value.void temphum13_setUserRegister( uint8_t register_content )
- sets user register content.Examples description
The application is composed of three sections :
void applicationTask( )
{
temperature = temphum13_getTemperature( );
humidity = temphum13_getHumidity( );
if (temperature != 65536.0)
{
FloatToStr( temperature, text );
FloatCut( );
mikrobus_logWrite( "> Temperature : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( celsius, _LOG_LINE );
}
if (humidity != 65536.0)
{
FloatToStr( humidity, text );
FloatCut( );
mikrobus_logWrite( "> Humidity : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " %RH", _LOG_LINE );
}
mikrobus_logWrite( " ", _LOG_LINE );
Delay_ms(500);
}
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.