Color 9 Click Board
Color 9 Click Board
The Color 9 Click Board™ is a very accurate colour sensing Click Board™ which features Broadcom's APDS-9250, IR and ambient light sensor. It contains a specially designed matrix of photosensitive elements, which can sense red, green, blue and IR components. Four low noise 18-bit ADCs ensure the high dynamic range, making this sensor suitable to be used behind dark glass.
This sensor offers a fast I2C interface for communication with the host MCU. It is perfect for sensing subtle light changes, as it is equipped not only with the red, green, and blue (RGB) but also the infra-red sensor, allowing a very accurate measurement of the subtlest changes in light.
Software Support
We provide a library for the Color 9 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library contains generic functions that will allow a user to easily get started with the click board.
Key Functions
uint32_t color9_getGreen()
- Return the value of the green color mesurement.uint32_t color9_getBlue()
- Return the value of the blue color mesurement.uint32_t color9_getRed()
- Return the value of the red color mesurement.
Example Description
The application is composed of three sections :
- System Initialization - Initialize GPIO, I2C and LOG structures.
- Application Initialization - Initialize the driver and test if the sensor is present. If the ID read from the sensor is correct execute the initialization procedure./li>
- Application Task - Wait for the color data to be available then read the data and send it to the serial port.
void applicationTask() { char txt[20]; uint8_t convComplete; uint32_t measurementData; convComplete = color9_gStatusreg(); if( convComplete & 0x08 ) { convComplete = 0; mikrobus_logWrite("Ir: ",_LOG_TEXT); measurementData=color9_getIr(); LongToStr(measurementData,txt); Ltrim(txt); mikrobus_logWrite(txt,_LOG_LINE); mikrobus_logWrite("Green: ",_LOG_TEXT); measurementData=color9_getGreen(); LongToStr(measurementData,txt); Ltrim(txt); mikrobus_logWrite(txt,_LOG_LINE); mikrobus_logWrite("Blue: ",_LOG_TEXT); measurementData=color9_getBlue(); LongToStr(measurementData,txt); Ltrim(txt); mikrobus_logWrite(txt,_LOG_LINE); mikrobus_logWrite("Red: ",_LOG_TEXT); measurementData=color9_getRed(); LongToStr(measurementData,txt); Ltrim(txt); mikrobus_logWrite(txt,_LOG_LINE); mikrobus_logWrite("--",_LOG_LINE); } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART Library
- I2C Library
- Conversions Library
- C_String Library
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.
MIKROSDK
The Color 9 Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Color 9 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.