apc1sensor 2.1.0.0
main.c File Reference

APC1 Sensor Demo example. More...

#include "board.h"
#include "log.h"
#include "apc1sensor.h"

Functions

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

Detailed Description

APC1 Sensor Demo example.

Description

This example demonstrates the use of APC1 Air Quality Sensor Bundle by reading measurement results (PM1.0, PM2.5, PM10, TVOC, eCO2, AQI, temperature, relative humidity, etc.).

The demo application is composed of two sections :

Application Init

Initializes the driver, performs the sensor default configuration, and reads the sensor name, serial number, and firmware version.

Application Task

Reads the measurement results and displays all data on the USB UART once per second.

Note
By default, the I2C communication interface is selected in the library, which is compatible with APC1001J sensor. If you are using an UART version of the sensor (APC1001U) refer to the apc1sensor_drv_interface_sel function description in order to properly change the interface selection in the library.
Author
Stefan Filipovic

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

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