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 (136707 times)
  2. FAT32 Library (69917 times)
  3. Network Ethernet Library (55932 times)
  4. USB Device Library (46256 times)
  5. Network WiFi Library (41883 times)
  6. FT800 Library (41144 times)
  7. GSM click (28978 times)
  8. PID Library (26407 times)
  9. mikroSDK (26355 times)
  10. microSD click (25351 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 2 click

Rating:

5

Author: MIKROE

Last Updated: 2018-05-07

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Temperature & humidity

Downloaded: 4086 times

Not followed.

License: MIT license  

Temp-Log click 2 is a precise ambient temperature measurement device, equipped with the additional non-volatile (EEPROM) memory, which can be used to permanently store system configuration and log application specific or user preference data.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Temp-Log 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Temp-Log 2 click" changes.

Do you want to report abuse regarding "Temp-Log 2 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 2 click

Temp-Log 2 click

Native view of the Temp-Log 2 click board.

View full image
Temp-Log 2 click

Temp-Log 2 click

Front and back view of the Temp-Log 2 click board.

View full image

Library Description

Library initializes and defines I2C driver and performs communication with device registers, reading and writting. Library also performs temperature measurement and converts 16-bit temperature data to the celsius value. Library has the ability to perform EEPROM programming, and data which is written to the EEPROM will be saved after power down. After reset command data in EEPROM will be updated to the device registers. For more details check documentation.

Key functions

uint8_t templog2_writeReg( uint8_t register_address, uint16_t transfer_data )- Function writes 16-bit data to register.

uint8_t templog2_readReg( uint8_t register_address, uint16_t *dataOut )- Function reads 16-bit data from register.

uint8_t templog2_readTemp( float *tempOut, uint8_t *tempSign )- Function gets 16-bit temperature data, converts value to celsius unit and returns temperature limit status.

uint8_t templog2_setMode( uint8_t opMode, uint8_t alertMode )- Function sets device in desired operation mode and alert mode, which determines how temperature limit status be set.

Example description

The application is composed of three sections :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes I2C driver and performs device configuration. Sets temperature limit, high limit to 25 Celsius and low limit to 0 Celsius. Sets total active conversion time to 250 ms and 8 average samples. Also sets Shutdown Mode as default mode, and after device reset puts device in Continuous Conversion Mode. High limit status will be set when temperature cross over the determined high limit temperature value. Low limit status will be set when temperature falls below the determined low limit temperature value.
  • Application Task - (code snippet) - Logs temperature value in celsius unit on USBUART and also logs message when high limit or low limit temperature is detected.
void applicationTask()
{
 checkLimit = templog2_readTemp( &temperature, &temperatureSign );
 FloatToStr( temperature, text );
 mikrobus_logWrite( "Temperature is: ", _LOG_TEXT );

 if (temperatureSign == 0)
 {
 mikrobus_logWrite( "-", _LOG_TEXT );
 }
 mikrobus_logWrite( text, _LOG_TEXT );
 mikrobus_logWrite( " Celsius", _LOG_LINE );

 if (checkLimit == 2)
 {
 mikrobus_logWrite( "High temperature limit detection!", _LOG_LINE );
 }
 if (checkLimit == 1)
 {
 mikrobus_logWrite( "Low temperature limit detection!", _LOG_LINE );
 }
 mikrobus_logWrite( "", _LOG_LINE );
}


Other mikroE Libraries used in the example:

  • Conversions
  • I2C
  • UART

Additional notes and information

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.

ALSO FROM THIS AUTHOR

IR Grid click

5

IR Grid click is a thermal imaging sensor. It has an array of 64 very sensitive factory calibrated IR elements (pixels), arranged in 4 rows of 16 pixels, each measuring an object temperature up to 300ËšC within its local Field of View (FOV).

[Learn More]

Accel 18 click

0

Accel 18 Click is a compact add-on board that contains an acceleration sensor. This board features the MC3419, a digital output 3-axis accelerometer with a feature set optimized for consumer product motion sensing from MEMSIC.

[Learn More]

Brushless 14 click

0

Brushless 14 Click is a compact add-on board suitable for controlling BLDC motors with any MCU. This board features the TB67B001FTG, a three-phase, brushless, Hall sensorless driver IC from Toshiba Semiconductor.

[Learn More]