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-25
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 4164 times
Not followed.
License: MIT license
Temp-Log 3 click is a temperature measuring Click board featuring the MCP9843 IC, an accurate temperature sensor IC with integrated EEPROM.
Do you want to subscribe in order to receive notifications regarding "Temp-Log 3 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Temp-Log 3 click" changes.
Do you want to report abuse regarding "Temp-Log 3 click".
Library Description
The library performs a control of the Temp-Log 3 Click board. There are a functions that offer a choice to measure the ambient temperature and set a temperature limit values to generate alarm. The library also can save a desired configurations or temperature values to the EEPROM, which has size of 256 bytes. For more details check documentation.
Key functions:
T_TEMPLOG3_RETVAL templog3_writeReg( uint8_t regAddr, uint16_t dataIn )
- Function writes a 16bit data to the desired register.T_TEMPLOG3_RETVAL templog3_getTemp( uint8_t tempSel, T_TEMPLOG3_DEG *tempOut )
- Function gets a temperature value from the desired temperature register calculated to the Celsius degrees.T_TEMPLOG3_RETVAL templog3_setTemp( uint8_t tempSel, T_TEMPLOG3_DEG tempIn )
- Function sets a desired temperature register on the desired value calculated to the Celsius degrees.void templog3_eepromByteWrite( uint8_t regAddr, uint8_t dataIn, uint8_t eepromMode )
- Function writes a one byte data to the EEPROM including/excluding a write protection.Examples description
The application is composed of the three sections :
void applicationTask()
{
templog3_waitConvDone();
retStatus = templog3_getTemp( _TEMPLOG3_TEMP_AMBIENT_REG, &temperature );
FloatToStr( temperature, text );
floatCut();
mikrobus_logWrite( "** Ambient temperature is : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
logUnit();
mikrobus_logWrite( " **", _LOG_LINE );
checkLimitStatus();
Delay_ms( 300 );
}
Additional Functions :
Other mikroE Libraries used in the example:
Conversions
I2C
UART
Additional notes and informations
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.