TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 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 (136721 times)
  2. FAT32 Library (69928 times)
  3. Network Ethernet Library (55939 times)
  4. USB Device Library (46264 times)
  5. Network WiFi Library (41884 times)
  6. FT800 Library (41168 times)
  7. GSM click (28979 times)
  8. PID Library (26412 times)
  9. mikroSDK (26357 times)
  10. microSD click (25355 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

AD-SWIO click

5

AD-SWIO Click is a quad-channel software configurable input/output solution based on AD74412R, for building and process control application. The AD74412R is a quad-channel software configurable input/output solution for building and process control applications.

[Learn More]

Clock Gen click

0

Clock Gen Click offers an ideal replacement for crystals, crystal oscillators, VCXOs, phase-locked loops (PLLs), and fanout buffers in cost-sensitive applications. This click features the Si5351A from Silicon Labs, an I2C configurable clock generator based on a PLL + high resolution MultiSynth fractional divider architecture which can generate any frequency up to 200 MHz on each of its outputs with 0 ppm error.

[Learn More]

MRAM 3 click

0

MRAM 3 Click is a compact add-on board representing a magneto-resistive random-access memory solution. This board features the AS3001204, 1Mb high-performance serial SPI MRAM memory organized as 128K words of 8 bits each from Avalanche Technology. The MRAM technology is analog to Flash technology with SRAM compatible read/write timings (Persistent SRAM, P-SRAM), where data is always non-volatile. It also has a hardware write-protection feature and performs read and write operations with data retention for one million years and a write endurance of 1014 cycles.

[Learn More]