temphum
2.0.0.0
|
Temp&Hum Click carries ST’s HTS221 temperature and relative humidity sensor.
We provide a library for the TempHum 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.
This library contains API for TempHum Click driver.
void temphum_cfg_setup ( temphum_cfg_t *cfg );
TEMPHIM_RETVAL temphum_init ( temphum_t *ctx, temphum_cfg_t *cfg );
void temphum_default_cfg ( temphum_t *ctx );
void temphum_get_temp_hum ( temphum_t *ctx, float *temperature, float *humidity );
This application measures temperature and humidity, with temperature in range of 0 - 60 deg.
The demo application is composed of two sections :
Initialization driver enable's - I2C, set default configuration and start write log.
This is a example which demonstrates the use of TempAndHum Click board. Measured temperature and humidity data from the HTS221 sensor. Convert temperature data to degrees Celsius [ �C ] and humidity data to percentarg [ % ]. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on usb uart changes for every 3 sec.
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:
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.