We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-08-12
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Optical
Downloaded: 3402 times
Not followed.
License: MIT license
Color 9 Click is a very accurate color sensing Click board which features the APDS-9250, IR and ambient light sensor, from Broadcom. It contains a specially designed matrix of photosensitive elements, which can sense red, green, blue and IR component.
Do you want to subscribe in order to receive notifications regarding "Color 9 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Color 9 click" changes.
Do you want to report abuse regarding "Color 9 click".
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.Examples description
The application is composed of three sections :
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); } }
Other mikroE Libraries used in the example:
Additional notes and informations
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.