TOP Contributors

  1. MIKROE (2655 codes)
  2. Alcides Ramos (353 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 (136781 times)
  2. FAT32 Library (69977 times)
  3. Network Ethernet Library (55948 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41888 times)
  6. FT800 Library (41183 times)
  7. GSM click (28987 times)
  8. PID Library (26419 times)
  9. mikroSDK (26372 times)
  10. microSD click (25381 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 8 click

Rating:

5

Author: MIKROE

Last Updated: 2019-04-17

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Optical

Downloaded: 3380 times

Not followed.

License: MIT license  

Ambient 8 click is equipped with the ambient light sensor (ALS) IC, providing measurements of the ambient light intensity in a digital format. It utilizes the LTR-329ALS-01, an ALS with the I2C interface.

No Abuse Reported

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

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

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

Ambient 8 click

Native view of the Ambient 8 click board.

View full image
Ambient 8 click

Ambient 8 click

Front and back view of the Ambient 8 click board.

View full image

Library Description

Library contains function for reading data from device registers Library contains function for writing data to device registers Libraty contains function for setting constants ( gain and integration time ) for Lux calculations Library contains function for device initialization Library contains function for reading ALS data ( channel 0 and channel 1 ) Library contains function for calculating Lux level based on ALS data from channels 0 and 1, window factor and IR factor.

Key functions:

  • void ambient8_setConstants( void ) - sets constants (gain and integration time) for lux level calculation.
  • void ambient8_init( void ) - initializes the device, sets gain to 8X, sets integration time to 400ms.
  • uint8_t ambient8_getLuxLevel( float * luxLevel_, float windowFactor_, float IRfactor_ ) - reads and data and performs lux level calculation.

Examples description

The application is composed of the three sections :

  • System Initialization - Initializes LOG and I2C.
  • Application Initialization - Initializes device and I2C driver.
  • Application Task - Performs Lux calculation based on window and IR factor and log results.
void applicationTask( )
{
    statusFlag = ambient8_getLuxLevel( &luxLevel, windowFactor, IRfactor );

    if (statusFlag == 0)
    {
        mikrobus_logWrite( "lux Level : ", _LOG_TEXT );
        FloatToStr( luxLevel, text );
        mikrobus_logWrite( text, _LOG_TEXT );
        mikrobus_logWrite( " lx", _LOG_LINE );
        mikrobus_logWrite( " ", _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 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

GainAMP 3 click

0

GainAMP 3 Click is a compact add-on board that contains a 4-channel programmable gain amplifier. This board features the ADA4254, a zero drift, high voltage, programmable gain instrumentation amplifier from Analog Devices. It features 12 binary weighted gains and three scaling gain options resulting in 36 possible gain settings. It comes with an input multiplexer providing ±60V protection to the high impedance inputs of the amplifier and an excitation current source output available to bias sensors such as resistance temperature detectors (RTDs).

[Learn More]

Magneto 7 click

5

Magneto 7 Click is a high-resolution magnetic sensor Click board which allows contactless orientation sensing.

[Learn More]

TempHum 17 click

0

Temp&Hum 17 Click is a compact add-on board that represents temperature and humidity sensing solutions. This board features the HS3001, a highly accurate, fully calibrated relative humidity and temperature sensor from Renesas. It features proprietary sensor-level protection, ensuring high reliability and long-term stability. Integrated calibration and temperature-compensation logic provides fully corrected RH and temperature values via standard I2C output. No user calibration of the output data is required.

[Learn More]