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: 2018-03-23
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 5390 times
Not followed.
License: MIT license
IR Sense 2 click is the infrared sensor Click board, designed to be used for the short range IR sensing applications. Unlike other pyroelectric sensors, it is able to sense environmental heat changes up to 1m, even through the glass.
Do you want to subscribe in order to receive notifications regarding "IR Sense 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "IR Sense 2 click" changes.
Do you want to report abuse regarding "IR Sense 2 click".
Library Description
The library contains basic functions for reading from, and configuring the clicks registers,
as well as functions for calculation of temperature and IR data.
Key functions
uint8_t irsense2_readReg(uint8_t registerAddress) - generic read function.
void irsense2_writeReg(uint8_t registerAddress, uint8_t data_) - generic read function.
float irsense2_readTemp() - reads temperature data, and converts to Celsius degrees.
float irsense2_readIR() - reads IR data, and converts to pA.
Examples Description
The demo application is composed of three sections:
void applicationTask() { char txt[10] = {0}; float temperature; float IRdata; temperature = irsense2_readTemp(); FloatToStr(temperature, txt); mikrobus_logWrite("Temperature reading: ",_LOG_TEXT); mikrobus_logWrite(txt,_LOG_LINE); IRdata = irsense2_readIR(); FloatToStr(IRdata, txt); mikrobus_logWrite("IR reading: ",_LOG_TEXT); mikrobus_logWrite(txt,_LOG_LINE); Delay_ms( 1000 ); }
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.