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: 2018-12-07
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 3954 times
Not followed.
License: MIT license
Temp&Hum 7 click is a Click board which is perfectly suited for measuring the relative humidity (RH) and temperature.
Do you want to subscribe in order to receive notifications regarding "Temp-Hum 7 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Temp-Hum 7 click" changes.
Do you want to report abuse regarding "Temp-Hum 7 click".
Library Description
The library contains functions for reading register content and setting register content Library contains functions for reading the electronic serial number and firmware revision Library contains functions for reading temperature (C), humidity(%RH) and heater current (mA) values Library contains a function for device reset.
Key functions:
void temphum7_setData( uint8_t command_, uint8_t dataIn_ );
- sets one byte of register datafloat temphum7_getRelativeHumidity( uint8_t mode_ )
- performs relative humidity measurement and calculates relative humidityfloat temphum7_getTemperature ( uint8_t mode_ )
- performs temperature measurement and calculates the temperatureExamples description
The application is composed of the three sections :
void applicationTask()
{
mikrobus_logWrite( " ", _LOG_LINE );
temperature = temphum7_getTemperature( _TEMPHUM7_HOLD_MASTER_MODE );
FloatToStr( temperature, text );
mikrobus_logWrite( " > > > temperature : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " C", _LOG_LINE );
relativeHumidity = temphum7_getRelativeHumidity( _TEMPHUM7_HOLD_MASTER_MODE );
FloatToStr( relativeHumidity, text );
mikrobus_logWrite( " > > > relative humidity : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " %RH", _LOG_LINE );
Delay_ms(1000);
}
Other mikroE Libraries used in the example:
I2C
UART
Conversions
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB UART 2 clickor 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.