co2 2.0.0.0
main.c File Reference

CO2 Click example. More...

#include "board.h"
#include "log.h"
#include "co2.h"

Macros

#define CO2_AIR_HUMIDITY   40/*< Relative air humidity in % */
 
#define CO2_AIR_PRESSURE   1008/*< Relative air pressure in mBar */
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

CO2 Click example.

Description

This example showcases ability of Click board. It reads ID's configures device for operation work and reads CO2 gas concentration in air and temperature of IC every second.

The demo application is composed of two sections :

Application Init

Initialization of host communication modules (UART, I2C). Checks device and serial ID's from device. Then calls default configuration function that resets device, self tests it selft and configures for measuring CO2 concentration from air.

Application Task

Reads air CO2 gas concentration in precentage and IC's temperature in deg Celzius in span of 1 second and logs data to UART Terminal.

Author
Luka Filipovic

Macro Definition Documentation

◆ CO2_AIR_HUMIDITY

#define CO2_AIR_HUMIDITY   40/*< Relative air humidity in % */

◆ CO2_AIR_PRESSURE

#define CO2_AIR_PRESSURE   1008/*< Relative air pressure in mBar */

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )