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-08-24
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Gas
Downloaded: 4201 times
Not followed.
License: MIT license
NDIR CO2 click is an advanced integrated CO2 gas sensor system, which is able to measure an absolute CO2 concentration, by utilizing the CDM7160 integrated sensor.
Do you want to subscribe in order to receive notifications regarding "NDIR CO2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "NDIR CO2 click" changes.
Do you want to report abuse regarding "NDIR CO2 click".
Library Description
Library initializes and defines I2C driver and performs writing to registers and reading from registers. Also has the ability to measure CO2 concentration in ppm unit. For more details check the documentation.
Key functions:
uint8_t ndirco2_writeReg( uint8_t register_address, uint8_t transfer_data )
- Function writes one byte data to register.uint8_t ndirco2_readReg( uint8_t register_address, uint16_t *dataOut )
- Function reads data from register.void ndirco2_readCO2( uint8_t setCheckMode, uint16_t *outputData )
- Function reads 15-bit CO2 concentration data from data registers only when data is ready for reading after each measurement or after number of measurements determined by AVE register + 1.Example description
The application is composed of three sections:
void applicationTask()
{
ndirco2_readCO2( _NDIRCO2_CHECK_EACH_MEASURE, &co2Data );
WordToStr( co2Data, text );
mikrobus_logWrite( "CO2 concentration is: ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( "ppm", _LOG_LINE );
}
Other MikroElektronika libraries used in the example:
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.