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-11
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 4676 times
Followed by: 4 users
License: MIT license
IrThermo 2 click carries the TMP007 infrared thermopile sensor with an integrated math engine. The measurement range of the sensor is between –40°C to 125°C (with a 14-bit resolution). IrThermo 2 click communicates with the target board MCU through mikroBUS I2C pins (SCL, SDA. The board is designed to use either a 3.3V or a 5V power supply.
Do you want to subscribe in order to receive notifications regarding "IrThermo 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "IrThermo 2 click" changes.
Do you want to report abuse regarding "IrThermo 2 click".
Front and back view of IrThermo 2 Click Board designed in mikroBUS form factor.
View full imageLibrary Description
The library covers all the necessary functions to control IrThermo 2 Click board. Library performs the communication with the device via I2C driver by writting to registers and by reading from registers. Library have generic write and read function, set default configuration function and get temperature value. Function who gets temperature also converts temperature data to degree Celsius [ °C ] and Fahrenheit [ °F ].
Key functions:
uint16_t irthermo2_readData( uint8_t address )
- Generic read 16-bit data from 8-bit address function.float irthermo2_getObjectTemperatureC()
- Get object temperature in degrees Celsius function.float irthermo2_getObjectTemperatureF()
- Get object temperature in degrees Fahrenheit function.Examples description
The application is composed of the three sections :
void applicationTask() { temperature = irthermo2_getObjectTemperatureC(); FloatToStr( temperature, logText ); mikrobus_logWrite( " Temperature : ", _LOG_TEXT ); mikrobus_logWrite( logText, _LOG_TEXT ); mikrobus_logWrite( " °C", _LOG_LINE ); mikrobus_logWrite( "---------------------------", _LOG_LINE ); Delay_ms( 5000 ); }
Other mikroE Libraries used in the example:
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.