TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136708 times)
  2. FAT32 Library (69917 times)
  3. Network Ethernet Library (55932 times)
  4. USB Device Library (46258 times)
  5. Network WiFi Library (41883 times)
  6. FT800 Library (41144 times)
  7. GSM click (28979 times)
  8. PID Library (26408 times)
  9. mikroSDK (26355 times)
  10. microSD click (25351 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

Light mix-sens click

Rating:

5

Author: MIKROE

Last Updated: 2020-07-14

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Optical

Downloaded: 1726 times

Not followed.

License: MIT license  

Light mix-sens Click is carrying TMD37253, an advanced proximity measurement, color sense (RGBC+IR), and digital ambient light sensing (ALS) device. The TMD37253 slim module package has been designed to accommodate a “single hole” aperture approach that incorporates an IR LED and factory calibrated LED driver.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Light mix-sens click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Light mix-sens click" changes.

Do you want to report abuse regarding "Light mix-sens click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Light mix-sens Click

Light mix-sens Click

Native view of the Light mix-sens Click board.

View full image
Light mix-sens Click

Light mix-sens Click

Front and back view of the Light mix-sens Click board.

View full image

Library Description

This library allows user to perform a communication with the Light mix-sens Click board. The user can measure the full spectral of light together with proximity measurement. By switching an IR diode, one of two possible IR measurements can be executed, the level of IR light can be measured, or the proximity, together with the all other channels. For more details, please, check the full documentation.

Key functions:

  • lightmixsens_err_t lightmixsens_write_byte( uint8_t reg_addr, uint8_t data_in ); - This function writes data byte to the selected register.
  • lightmixsens_err_t lightmixsens_read_byte( uint8_t reg_addr, uint8_t *data_out ); - This function reads data byte from the selected register.
  • void lightmixsens_switch_ir_to_green( void ); - This function switches the IR light to be measured in the Green channel (GDATA) register.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes all necessary peripherals and pins.
  • Application Initialization - Initializes I2C driver and performs the Click board default configuration to allow ALS/Color and Proximity measurements.
  • Application Task - (code snippet) - Waits until ALS/Color integration cycle was done and then reads the entire measurement. The all results will be sent to the selected UART terminal.
void application_task( )
{
    lightmixsens_wait_atime( );
    
    lightmixsens_read_word( LIGHTMIXSENS_REG_CDATA, &lightmixsens_cdata );
    lightmixsens_read_word( LIGHTMIXSENS_REG_RDATA, &lightmixsens_rdata );
    lightmixsens_read_word( LIGHTMIXSENS_REG_GDATA_IRDATA, &lightmixsens_gdata );
    lightmixsens_read_word( LIGHTMIXSENS_REG_BDATA, &lightmixsens_bdata );
    lightmixsens_read_byte( LIGHTMIXSENS_REG_PDATA, &lightmixsens_pdata );
    
    WordToStr( lightmixsens_cdata, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( "- Clear light:  ", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_TEXT );
    mikrobus_logWrite( " lx", _LOG_LINE );
    
    WordToStr( lightmixsens_rdata, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( "- Red light:    ", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_TEXT );
    mikrobus_logWrite( " lx", _LOG_LINE );
    
    WordToStr( lightmixsens_gdata, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( "- Green light:  ", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_TEXT );
    mikrobus_logWrite( " lx", _LOG_LINE );
    
    WordToStr( lightmixsens_bdata, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( "- Blue light:   ", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_TEXT );
    mikrobus_logWrite( " lx", _LOG_LINE );
    
    prox_app( );
    mikrobus_logWrite( "** Proximity:   ", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    
    mikrobus_logWrite( "", _LOG_LINE );
}


Additional Functions :

  • prox_app - This is application function which determines the proximity results.

Other mikroE Libraries used in the example:

  • Conversions
  • C_String
  • I2C
  • UART

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

Light Temp click

0

Light Temp Click is a dual-channel LED driver, designed to be used in tunable Smart Connected Lighting (SCL) applications.

[Learn More]

Heart Rate 10 click

0

Heart Rate 10 Click is a compact add-on board suitable for heart rate monitoring applications. This board features the MAX86916, an integrated optical sensor with applications in bio-sensing, proximity, and color from Maxim Integrated.

[Learn More]

BarGraph click - Cloud Demo

5

- The example contains all the necessary initializations and settings for a G2C click on a successful connection by Click Cloud. - BarGraph click (actuator) displays value of the counter that is settings on the Cloud. - This example demonstrate using the Actuator(counter) parser.

[Learn More]