- CIC Prefix : IRGRID
- Author : MikroE Team
- Verison : 1.0.0
- Date : Mar 2018.
We provide a library for the IR_Grid Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library performs IR and temperature measurement. Sensor gets IR picture of detected object (body) and measures ambient temperature, compares that two measurements and shows IR picture as 16x4 matrix. For more details check documentation.
Key functions :
uint8_t irgrid_deviceInit(uint8_t refrate)
- Device Initializationuint8_t irgrid_measure()
- Measurementvoid irgrid_get_ir_raw(int16_t *buffer)
- Read Raw Temperature buffervoid irgrid_get_temperature(float *buffer)
- Read Calculated Temperature bufferfloat irgrid_get_amb_temperature()
- Read Ambient Temperature
Examples Description
The application is composed of three sections :
- System Initialization - Initializes I2C module and USB UART for data logging
- Application Initialization - Initializes driver init and IR Grid module
- Application Task - (code snippet) - Reads the temperature of all pixels and creates a pixel temperature matrix that logs on usbuart every half of second
void applicationTask()
{
uint8_t i;
uint8_t rc;
uint8_t cc;
if( 1 != irgrid_measure() )
{
irgrid_get_temperature( &ir_tmp[ 0 ] );
}
for (rc = 0; rc < 4; rc++)
{
for (cc = 0; cc < 16; cc++)
{
i = (cc * 4) + rc;
FloatToStr( ir_tmp[ i ], demoText );
Ltrim( demoText );
demoText[ 6 ] = 0;
mikrobus_logWrite( demoText, _LOG_TEXT );
mikrobus_logWrite( " ", _LOG_TEXT );
}
mikrobus_logWrite( " " ,_LOG_LINE );
}
mikrobus_logWrite( " " ,_LOG_LINE );
mikrobus_logWrite( " " ,_LOG_LINE );
mikrobus_logWrite( " " ,_LOG_LINE );
Delay_ms(500);
}
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
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.