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-01-29
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Gas
Downloaded: 5960 times
Not followed.
License: MIT license
Air quality 4 click uses for measurement of H2, TVOC, CO2 and EthOH concentracion in air.
Do you want to subscribe in order to receive notifications regarding "Air quality 4 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Air quality 4 click" changes.
Do you want to report abuse regarding "Air quality 4 click".
Library Description
Initializes and defines I2C bus driver and driver functions which perform measurements of H2, TVOC, CO2 and EthOH (Ethanol) concentration in the air. Check the documentation for more details.
Key functions
void air_quality4_measureQuality(uint8_t *readAir) - The function writes 6 bytes CO2 data (2 bytes) and TVOC data (2 bytes) with CRC data for each of them to a buffer, pointed by the function parameter.
void air_quality4_getCO2AndTVOC(uint16_t *value) - The function writes 2 bytes CO2 data and 2 bytes TVOC data without CRC data to a buffer, pointed by the function parameter.
void air_quality4_measureSignal(uint8_t *readAir) - The function writes 6 bytes H2 data (2 bytes) and EthOH - Ethanol data (2 bytes) with CRC data for each of them to a buffer, pointed by the function parameter.
void air_quality4_getH2AndEthOH(uint16_t *value) - The function writes 2 bytes of H2 data and 2 bytes of EthOH data without CRC data to a buffer, pointed by the function parameter.
Examples Description
void applicationTask() { air_quality4_getH2AndEthOH(&data_buffer[0]); IntToStr(data_buffer[0], text); mikrobus_logWrite("H2 value is: ", _LOG_TEXT); mikrobus_logWrite(text, _LOG_LINE); IntToStr(data_buffer[1], text); mikrobus_logWrite("EthOH value is: ", _LOG_TEXT); mikrobus_logWrite(text, _LOG_LINE); air_quality4_setBaseline(); air_quality4_getCO2AndTVOC(&data_buffer[0]); IntToStr(data_buffer[0], text); mikrobus_logWrite("CO2 value is: ", _LOG_TEXT); mikrobus_logWrite(text, _LOG_LINE); IntToStr(data_buffer[1], text); mikrobus_logWrite("TVOC value is: ", _LOG_TEXT); mikrobus_logWrite(text, _LOG_LINE); Delay_ms(1000); }
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.