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-01-15
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 3600 times
Not followed.
License: MIT license
Thermo 8 click is a very accurate thermometer Click board, with a very high typical measurement accuracy of ±0.25°C, and great data repeatability of ±0.0625°C. Besides measuring the temperature, this Click board offers a set of very useful features, such as the thermostat function, interrupt event and critical temperature alert function.
Do you want to subscribe in order to receive notifications regarding "Thermo 8 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Thermo 8 click" changes.
Do you want to report abuse regarding "Thermo 8 click".
Library Description
Library contains generic functions for working with the click board.
Key functions:
void thermo8_setResolution(uint8_t rCfg)
- Function for setting the measurement resolution.uint8_t thermo8_aleGet()
- Function for returning the state of the alert pin.float thermo8_getTemperatue()
- Function for reading the temperature.Examples description
The application is composed of the three sections :
void applicationTask()
{
float T_Data;
char text[15];
char alert;
char alertOn;
Delay_ms(2000);
alert = thermo8_aleGet();
if(alert == 0)
{
T_Data = thermo8_getTemperatue();
alertOn = thermo8_getAlertstat();
FloatToStr(T_Data,&text[0]);
text[5] = 0;
}
if(alertOn & THERMO8_TLOWER_REACHED)
{
mikrobus_logWrite("Temperature under the low limit: ",_LOG_TEXT);
mikrobus_logWrite(&text[0],_LOG_TEXT);
mikrobus_logWrite("°C",_LOG_LINE);
}
if(alertOn & THERMO8_TUPPER_REACHED)
{
mikrobus_logWrite("Temperature over the high limit: ",_LOG_TEXT);
mikrobus_logWrite(&text[0],_LOG_TEXT);
mikrobus_logWrite("°C",_LOG_LINE);
}
}
Other mikroE Libraries used in the example:
Conversions Library
C_String Library
I2C Library
UART Library
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.