TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136660 times)
  2. FAT32 Library (69898 times)
  3. Network Ethernet Library (55917 times)
  4. USB Device Library (46248 times)
  5. Network WiFi Library (41881 times)
  6. FT800 Library (41126 times)
  7. GSM click (28971 times)
  8. PID Library (26406 times)
  9. mikroSDK (26343 times)
  10. microSD click (25350 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Temp-Log 3 click

Rating:

5

Author: MIKROE

Last Updated: 2019-01-25

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Temperature & humidity

Downloaded: 3585 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.

No Abuse Reported

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".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Temp-Log 3 Click

Temp-Log 3 Click

Native view of the Temp-Log 3 Click board.

View full image
Temp-Log 3 Click

Temp-Log 3 Click

Front and back view of the Temp-Log 3 Click board.

View full image

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 :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes I2C interface and performs a device configuration for properly working. Also sets the temperature limit to the desired values.
  • Application Task - (code snippet) - First ensures that the minimum conversion time is met, and then reads the ambient temperature calculated to the Celsius degrees. Also checks the limit status and shows a message when some limit condition is met. Note : The temperature range that can be measured or written is from -40 to +125 Celsius degrees. The user can change the measured temperature resolution, but the range remains the same. The limit temperature resolution is always a 10bit, or 0.25 Celsius degrees. If user wants to enable the EEPROM Write Protection, the A0 pin on the device must be set to the high voltage level.
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 :

  • floatCut - Makes that float values be rounded on two decimal places.
  • logUnit - Writes a Celsius degrees symbol on uart terminal.
  • checkLimitStatus - Checks the limit status for each temperature reading cycle and writes a message on uart terminal when some limit condition is met.

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 clickUSB 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.

ALSO FROM THIS AUTHOR

Qi Receiver click

0

Qi Receiver click is based on the P9025AC 5W Qi wireless power receiver integrated circuit, with the advanced Foreign Object Detection (FOD) feature, from IDT. The click utilizes the principles of the inductive coupling for the purpose of wireless power transfer.

[Learn More]

I2C to SPI click

0

I2C to SPi Click is an all-in-one solution which allows serving as an interface between a standard I2C-bus of a microcontroller and an SPi bus, which allows the microcontroller to communicate directly with SPi devices through its I2C-bus. It is equipped with the stacking headers, so it can be easily connected.

[Learn More]

Expand 13 click

0

Expand 13 Click is a compact add-on board that contains a multi-port I/O expander. This board features the PI4IOE5V96248, a 48-bit general-purpose I/O expander providing remote I/O expansion for most MCU’s families from Diodes Incorporated. The PI4IOE5V96248 comes in a 6-channel configuration and allows easy addition of I/O through a standard I2C serial interface. It has a built-in level shifting feature that makes it highly flexible in power supply systems where communication between incompatible I/O voltages is required.

[Learn More]