TOP Contributors

  1. MIKROE (2649 codes)
  2. Alcides Ramos (350 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 (136503 times)
  2. FAT32 Library (69710 times)
  3. Network Ethernet Library (55813 times)
  4. USB Device Library (46153 times)
  5. Network WiFi Library (41792 times)
  6. FT800 Library (40974 times)
  7. GSM click (28918 times)
  8. PID Library (26379 times)
  9. mikroSDK (26267 times)
  10. microSD click (25291 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

Ambient 5 click

Rating:

5

Author: MIKROE

Last Updated: 2019-01-30

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Optical

Downloaded: 3240 times

Not followed.

License: MIT license  

Ambient 5 click can sense the intensity of the ambient light, providing measurement data in a digital format, over the I2C interface. It utilizes the VEML6030, a miniature ambient light sensor (ALS) which occupies only 2x2 mm of space.

No Abuse Reported

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

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

Do you want to report abuse regarding "Ambient 5 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

Ambient 5 click

Ambient 5 click

Native view of the Ambient 5 click

View full image
Ambient 5 click

Ambient 5 click

Front and back view of the Ambient 5 click.

View full image

Library contains functions for reading from and writing to selected registers Library contains functions for calculating refresh time, data resolution and light level Library contains functions for powering device on and checking state of int pin Library contains functions for setting high and low threshold values.

Key functions:

  • void ambient5_powerOn( void ) - Fpowers device on and sets basic settings.
  • float ambient5_getHighResolutionLightLevel( void ) - returns ambient light level in lux [lx].
  • uint16_t ambient5_getRefreshTime( void ) - returns time needed for new data to become available.

Examples description

The application is composed of the three sections :

  • System Initialization - Initializes i2c, log, and INT pin as input.
  • Application Initialization - Initializes i2c driver, powers the device and calculates refresh time.
  • Application Task - Logs high resolution data after a period of time ( refresh time calculated using - ambient5_getRefreshTime( ) ).
void applicationTask( )
{
    for (i = 0; i < rTime; i ++)
    {
        Delay_ms(1);
    }
    
    highResLightLevel = ambient5_getHighResolutionLightLevel( );

    FloatToStr( highResLightLevel, text );

    mikrobus_logWrite( " Ambient Light Level :   ", _LOG_TEXT );
    mikrobus_logWrite( text, _LOG_TEXT );
    mikrobus_logWrite( "  lx", _LOG_LINE );
}

Other mikroE Libraries used in the example:

  • I2C
  • UART
  • Conversions

Additional notes and informations

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

Hall Current 7 click

5

Hall Current 7 Click is a compact add-on board that provides economical and precise solutions for AC or DC current sensing.

[Learn More]

Current click

0

This project is a simple demonstration of working with the <b>Current Click</b> board based on the MCP3201 12-bit Analog-to-Digital Converter (ADC) with SPI Interface. This example demosntrates measuring the current drawn by the consumer using a shunt resistor.

[Learn More]

Smoke click

0

Smoke click carries the MAX30105 high-sensitivity optical sensor for smoke detection. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target MCU over I2C interface with additional functionality provided by the INT pin on the mikroBUS™ line.

[Learn More]