ambient5 2.0.0.0
|
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.
We provide a library for the Ambient5 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Ambient5 Click driver.
- Initialization function.void ambient5_cfg_setup ( ambient5_cfg_t *cfg );
AMBIENT5_RETVAL ambient5_init ( ambient5_t *ctx, ambient5_cfg_t *cfg );
void ambient5_default_cfg ( ambient5_t *ctx );
- This function reads data from the desired register.void ambient5_set_register ( ambient5_t *ctx, uint8_t reg_addr, uint16_t reg_value );
uint16_t ambient5_get_register ( ambient5_t *ctx, uint8_t reg );
The demo application is composed of two sections :float ambient5_get_resolution ( ambient5_t* ctx );
Initializes i2c driver, powers the device and calculates refresh time
Logs high resolution ambient light data after a period of time.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
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. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.