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: 2018-03-28
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Optical
Downloaded: 4651 times
Not followed.
License: MIT license
Spectral 2 click is a multispectral color sensing device, which uses the state-of-the-art sensor IC for a very accurate color sensing.
Do you want to subscribe in order to receive notifications regarding "Spectral 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Spectral 2 click" changes.
Do you want to report abuse regarding "Spectral 2 click".
Library Description
This library will allow you to read the RGB values from the Spectral 2 click board sensor.
Key functions:
Examples Description
The demo application is composed of three sections:
void applicationTask() { mikrobus_logWrite("-------------------",_LOG_LINE); fData = spectral2_getCalibratedData(_SPECTRAL2_CALIBRATED_DATA_R); FloatToStr(fData,fText); mikrobus_logWrite("-- R ( Red data ) :",_LOG_TEXT); mikrobus_logWrite(fText,_LOG_LINE); fData = spectral2_getCalibratedData(_SPECTRAL2_CALIBRATED_DATA_G); FloatToStr(fData,fText); mikrobus_logWrite("-- G ( Green data ) :",_LOG_TEXT); mikrobus_logWrite(fText,_LOG_LINE); fData = spectral2_getCalibratedData(_SPECTRAL2_CALIBRATED_DATA_B); FloatToStr(fData,fText); mikrobus_logWrite("-- B ( Blue data ) :",_LOG_TEXT); mikrobus_logWrite(fText,_LOG_LINE); fData = spectral2_getCalibratedData(_SPECTRAL2_CALIBRATED_DATA_Y); FloatToStr(fData,fText); mikrobus_logWrite("-- Y ( Yellow data ) :",_LOG_TEXT); mikrobus_logWrite(fText,_LOG_LINE); fData = spectral2_getCalibratedData(_SPECTRAL2_CALIBRATED_DATA_O); FloatToStr(fData,fText); mikrobus_logWrite("-- O ( Orange data ) :",_LOG_TEXT); mikrobus_logWrite(fText,_LOG_LINE); fData = spectral2_getCalibratedData(_SPECTRAL2_CALIBRATED_DATA_V); FloatToStr(fData,fText); mikrobus_logWrite("-- V ( Violet data ) :",_LOG_TEXT); mikrobus_logWrite(fText,_LOG_LINE); Delay_1sec(); }
mikroE Libraries used in the example:
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.