ambient21 2.1.0.0
|
Ambient 21 Click is a compact add-on board used to measure the amount of the present ambient light. This board features ams AG's TSL2591, a very-high sensitivity light-to-digital converter that transforms light intensity to a digital signal output capable of the direct I2C interface. It combines one broadband photodiode (visible plus infrared) and one infrared-responding photodiode on a single CMOS integrated circuit, providing a flexible and wide operating range of up to 88klx with an excellent responsivity close to the human eyes' response. The TSL2591 also has a programmable interrupt function and an integrated filter to reduce unwanted IR signals from the environment, improving lux accuracy across various light sources.
We provide a library for the Ambient 21 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
This library contains API for Ambient 21 Click driver.
ambient21_cfg_setup
Config Object Initialization function. ambient21_init
Initialization function. ambient21_default_cfg
Click Default Configuration function. ambient21_get_int_pin
This function returns the INT pin logic state. ambient21_read_raw_data
This function checks if the data is ready and then reads the raw ADC data from two channels. ambient21_measure_light_level
This function reads the raw ADC data from two channels and then measures the light level in lux based on those readings. This example demonstrates the use of Ambient 21 click board by measuring the ambient light level in Lux.
The demo application is composed of two sections :
Initializes the driver and performs the click default configuration.
Waits for the data ready interrupt, then reads the ambient light level in Lux
and displays the results on the USB UART. By default, the data ready interrupt triggers upon every ADC cycle which occurs every 200ms.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
Additional notes and informations
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. UART terminal is available in all MikroElektronika compilers.