environment4 2.1.0.0
main.c File Reference

Environment 4 Click example. More...

#include "board.h"
#include "log.h"
#include "environment4.h"
#include "sensirion_gas_index_algorithm.h"

Functions

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

Detailed Description

Environment 4 Click example.

Description

This example demonstrates the use of Environment 4 click board by reading the temperature and humidity data and calculating VOC and NOx indexes.

The demo application is composed of two sections :

Application Init

Initializes the driver, and reads and displays the SGP41 sensor unique serial number and performs its build-in self-test. After that performs the SHT41 sensor software reset and reads its unique serial number. Finally, it initializes the sensirion gas index algorithm for VOC and NOx index calculation.

Application Task

Reads the temperature (degC) and the relative humidity (RH) data from SHT41 sensor with high precision. For the first 10 seconds it executes NOx conditioning and after that it reads the raw signals for VOC and NOx data and processes them with sensirion's gas index algorithm for calculating VOC and NOx indexes. All data will be displayed on the USB UART approximately once per second.

Note
Time required for reliably detecting VOC and NOx events on switching ON is typically less than 60 seconds. Refer to the SGP41 sensor datasheet for more timing specifications.
Author
Stefan Filipovic

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click 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 )