Use your forum account to login.


TOP Contributors

  1. MikroElektronika Team (778 codes)
  2. Shawon Shahryiar (263 codes)
  3. Alcides Ramos Zambrano (172 codes)
  4. S P (67 codes)
  5. Dany (66 codes)
  6. MikroBUS.NET Team (35 codes)
  7. NART SCHINACKOW (34 codes)
  8. Armstrong Subero (27 codes)
  9. Roman Toropov (26 codes)
  10. FOURNET Olivier (25 codes)

Most Downloaded

  1. Timer Calculator (96891 times)
  2. FAT32 Library (51065 times)
  3. Network Ethernet Library (45500 times)
  4. USB Device Library (35602 times)
  5. Network WiFi Library (32614 times)
  6. FT800 Library (28636 times)
  7. GSM click (22014 times)
  8. PID Library (21794 times)
  9. microSD click (18235 times)
  10. GSM 2 click (15089 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Spectral click



Author: MikroElektronika Team

Last Updated: 2018-02-23

Category: Optical

Downloaded: 1048 times

Not followed.

License: MIT license  

Spectral click is a light multispectral sensing device, which uses the state-of-the-art sensor IC for a very accurate true-color sensing. Spectral click provides a direct reading of the XYZ color coordinates, consistent with the CIE 1931 2. standard color space.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Spectral click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Spectral click" changes.

Do you want to report abuse regarding "Spectral click".

  • Information
  • Comments (0)

mikroSDK Library Blog

Spectral click

Spectral click

Native view of the Sprectral click board.

View full image
Spectral click

Spectral click

Front and back view of the Spectral click board.

View full image

Library Description

Library initializes and defines UART driver and functions witch offer a choice to providing direct XYZ color coordinates consistent with the CIE 1931.

  1. Standard Observer color coordinates. It also maps the XYZ coordinates to the x, y (Y) of the 2-dimensional color gamut and scales the coordinates to the CIE 1976 u’v’ coordinate system. The library provides accurate Correlated Color Temperature (CCT) measurements and provides color point deviation from the black body curve for white light color in the delta u’ v’ coordinate system. Check documentation for more details.

Key functions:

  • void spectral_getColor_Data(uint8_t *rsp, uint8_t *) - Reads calibrated X, Y, and Z color data.
  • void spectral_getXYsmall_Data(uint8_t *rsp, uint8_t *xyData) - Reads calibrated x and y for CIE 1931 color gamut.
  • uint8_t spectral_getLUX_Data(uint8_t *rsp) - Reads calibrated LUX value from the sensor.
  • uint8_t spectral_getCCT_Data(uint8_t *rsp) - Reads calibrated CCT value from the sensor.
  • void spectral_getUV_Data(uint8_t *rsp, uint16_t *uvData) - Reads calibrated u’, v’ and u, v for CIE 1976 color gamut.

Examples Description

The demo application is composed of three sections:

  • System Initialization - Initializes all necessary GPIO pins, UART used for
    the communcation with Spectral and UART used for infromation logging.
  • Application Initialization - Initializes driver, reset module and sends
    command for the default module configuration.
  • Application Task - (code snippet) - Sends the command to start reading data.
    Then logs to USBUART, six read values every 1 second.
void applicationTask()

 mikrobus_logWrite( "-- X value:", _LOG_TEXT );
 mikrobus_logWrite( text, _LOG_LINE );

 mikrobus_logWrite( "-- Y value:", _LOG_TEXT );
 mikrobus_logWrite( text, _LOG_LINE );

 mikrobus_logWrite( "-- Z value:", _LOG_TEXT );
 mikrobus_logWrite( text, _LOG_LINE );

 mikrobus_logWrite( "-- NIR value:", _LOG_TEXT );
 mikrobus_logWrite( text, _LOG_LINE );

 mikrobus_logWrite( "-- D value:", _LOG_TEXT );
 mikrobus_logWrite( text, _LOG_LINE );

 mikrobus_logWrite( "-- C value:", _LOG_TEXT );
 mikrobus_logWrite( text, _LOG_LINE );

 mikrobus_logWrite( "---------------------", _LOG_LINE );


Along with the demo application timer initialization functions are provided. Note that the timer is configured acording to the default develoment system and MCUs, changing the system or MCU may require an update of the timer init and timer ISR functions.

mikroE Libraries used in the example:

  • String
  • Conversions
  • UART

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.


RS485 isolator click


RS485 Isolator click is a RS485 communication isolator, and carries the ADM2682EBRIZ, a 5 kV rms signal and power isolated RS-485 transceiver.

[Learn More]

Secure click


Secure click carries the ATECC508A cryptographic coprocessor with secure hardware-based key storage. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over I2C interface.

[Learn More]

Bluetooth click - Example


Example for Bluetooth click board in mikroBUS form factor. This expects a message from the Master (Bluetooth dongle, mobile phone, etc) and displays in on the Lcd.

[Learn More]