color4 2.1.0.0
main.c File Reference

Color 4 Click example. More...

#include "board.h"
#include "log.h"
#include "color4.h"

Macros

#define COLOR4_LIM_WHITE_COLOR   17000
 
#define COLOR4_LIM_DARK_LUX   15.0
 
#define COLOR4_CCT_LIM_BLUE_COLOR   9000
 
#define COLOR4_CCT_LIM_PURPLE_COLOR   7500
 
#define COLOR4_CCT_LIM_GREEN_COLOR   6000
 
#define COLOR4_CCT_LIM_YELLOW_COLOR   3500
 
#define COLOR4_CCT_LIM_ORANGE_COLOR   2200
 
#define COLOR4_CCT_LIM_PINK_COLOR   1900
 
#define COLOR4_CCT_LIM_RED_COLOR   700
 

Functions

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

Detailed Description

Color 4 Click example.

Description

This library contains API for the Color 4 Click driver. This driver provides the functions for the sensor configuration and for reading RGBW and ambient light data from the device. This example displays RGBW data, Ambient light level, CCT data and the light color names.

The demo application is composed of two sections :

Application Init

Initialization of I2C module and log UART. After driver initialization, default settings turn on the device.

Application Task

This example demonstrates the use of the Color 4 Click board™. Reads and displays the results of the RGBW, Ambient light level, calculate the correlated color temperature. This example also detects and displays the light color names. Results are being sent to the UART Terminal, where you can track their changes.

Note
Color detection is obtained based on the analysis of calculate the correlated color temperature (CCT) data and the CIE 1931 chromaticity diagram. For more details please refer to the “Designing the VEML6040 into an Application” application note (www.vishay.com/doc?84331).
Author
Nenad Filipovic

Macro Definition Documentation

◆ COLOR4_CCT_LIM_BLUE_COLOR

#define COLOR4_CCT_LIM_BLUE_COLOR   9000

◆ COLOR4_CCT_LIM_GREEN_COLOR

#define COLOR4_CCT_LIM_GREEN_COLOR   6000

◆ COLOR4_CCT_LIM_ORANGE_COLOR

#define COLOR4_CCT_LIM_ORANGE_COLOR   2200

◆ COLOR4_CCT_LIM_PINK_COLOR

#define COLOR4_CCT_LIM_PINK_COLOR   1900

◆ COLOR4_CCT_LIM_PURPLE_COLOR

#define COLOR4_CCT_LIM_PURPLE_COLOR   7500

◆ COLOR4_CCT_LIM_RED_COLOR

#define COLOR4_CCT_LIM_RED_COLOR   700

◆ COLOR4_CCT_LIM_YELLOW_COLOR

#define COLOR4_CCT_LIM_YELLOW_COLOR   3500

◆ COLOR4_LIM_DARK_LUX

#define COLOR4_LIM_DARK_LUX   15.0

◆ COLOR4_LIM_WHITE_COLOR

#define COLOR4_LIM_WHITE_COLOR   17000

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 )

◆ display_color()

void display_color ( void )

◆ main()

int main ( void )