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-10-12
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Gas
Downloaded: 3695 times
Not followed.
License: MIT license
CO 2 click is a very accurate, carbon-monoxide-gas-sensor Click board, equipped with the SPEC amperometric, 3SP CO 1000 gas sensor which electrochemically reacts with the carbon monoxide (CO).
Do you want to subscribe in order to receive notifications regarding "CO 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "CO 2 click" changes.
Do you want to report abuse regarding "CO 2 click".
Library Description
Library offers a choice to communicate with the CO 2 Click board by writting to the registers and by reading from the registers via I2C interface. Library consists of functions which can read CO measured and converted data from the 12-bit AD converter. Library also can calculate CO digital value to the ppm value. For more details check documentation.
Key functions:
uint8_t co2_writeReg( uint8_t register_address, uint8_t transfer_data )
- Function writes one byte to the register.uint8_t co2_readReg( uint8_t register_address, uint8_t *dataOut )
- Function reads one byte from the register.void co2_readADC( uint16_t *dataOut )
- Function reads converted data (CO) from the 12-bit AD converter.void co2_getCOppm( float *coData )
- Function reads CO converted data and calculates this value to the ppm.Example description
The application is composed of three sections :
void applicationTask()
{
co2_waitI2CReady();
co2_getCOppm( &coValue );
FloatToStr( coValue, text );
cutFloat();
mikrobus_logWrite( "CO : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " ppm", _LOG_LINE );
Delay_ms( 300 );
}
Additional Functions :
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.