TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 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 (136955 times)
  2. FAT32 Library (70079 times)
  3. Network Ethernet Library (56015 times)
  4. USB Device Library (46338 times)
  5. Network WiFi Library (41958 times)
  6. FT800 Library (41266 times)
  7. GSM click (29051 times)
  8. mikroSDK (26480 times)
  9. PID Library (26447 times)
  10. microSD click (25411 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: 4104 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

DC MOTOR 10

5

DC Motor 10 Click is a brushed DC motor driver with the current limiting and current sensing. It is based on the TLE 6208-6 G, an Hex-Half-Bridge / Double Six-Driver IC, optimized for motor driving applications.

[Learn More]

2x5W Amp click

6

2x5W AMP click functions as an amplifier and features the TDA7491LP 2x5-watt dual BTL class-D audio amplifier. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target MCU over the following pins on the mikroBUSâ„¢ line: AN, RST, CS, PWM, INT.

[Learn More]

Expand 8 click

5

Expand 8 Click is a compact add-on board that contains a multi-port I/O expander with bi-directional input/outputs. This board features the MAX7317, 10-Port SPI-interfaced I/O expander with overvoltage and hot-insertion protection from Maxim Integrated. The MAX7317 provides microprocessors with 10 I/O ports rated to 7V. Each port can be individually configured as either an open-drain output or an overvoltage-protected Schmitt input that supports hot insertion. All port pins remain high impedance in Power-Down mode with up to 8V asserted on them.

[Learn More]