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-06-13
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 3642 times
Not followed.
License: MIT license
IR Sense 3 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 3 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "IR Sense 3 click" changes.
Do you want to report abuse regarding "IR Sense 3 click".
Library Description
The library initializes and defines the I2C bus driver and drivers that offer a choice for writing data in register and reads data form register. The library includes function for read Temperature data in C and output current of the IR sensor in pA. The user also has the function for default configuration chip for measuremen, function for software reset device, function for get Interrupt state.
Key functions:
float irsense3_getTemperature()
- Temperature data.float irsense3_getIRSensorData()
- Output currentof the IR sensor.uint8_t irsense3_humanApproachDetect()
- Human approach detection.Examples description
The application is composed of the three sections :
void applicationTask()
{
float Temperature;
float IR_Current_data;
char demoText[ 50 ];
uint8_t fDetect;
/* Detection Object */
fDetect = irsense3_humanApproachDetect();
if (fDetect != 0)
{
mikrobus_logWrite(" Human Approach detected !!!", _LOG_LINE);
Delay_1sec();
}
/* Output current of IR sensor */
IR_Current_data = irsense3_getIRSensorData();
FloatToStr(IR_Current_data, demoText);
mikrobus_logWrite("--- IR current data: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" pA", _LOG_LINE);
/* Temperature */
Temperature = irsense3_getTemperature();
FloatToStr(Temperature, demoText);
mikrobus_logWrite("--- Temperature: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" C", _LOG_LINE);
mikrobus_logWrite("----------------------------- ", _LOG_LINE);
Delay_100ms();
}
Other mikroE Libraries used in the example:
I2C Library
Conversions library
UART Library
Additional notes and informations
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.