ambient9 2.0.0.0
|
Ambient 9 Click is a compact add-on board that contains an integrated ambient light sensing and proximity detector with IR LED in an optical module. This board features the APDS-9160-003, digital ALS, and IR sensing, an IR LED, and a complete proximity sensing solution from Broadcom Limited, that is fit to be used under a small aperture of the devices cover windows. It has a wide dynamic range, the proximity detection feature operates well from bright sunlight to dark rooms, and both the PS and ALS functions independently provides maximum flexibility in applications.
We provide a library for the Ambient9 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 Ambient9 Click driver.
- Initialization function.void ambient9_cfg_setup ( ambient9_cfg_t *cfg );
AMBIENT9_RETVAL ambient9_init ( ambient9_t *ctx, ambient9_cfg_t *cfg );
- Generic function for reading proximity data from sensoruint32_t ambient9_als_data ( ambient9_t *ctx );
uint16_t ambient9_proxy_data ( ambient9_t *ctx );
void ambient9_enable_data ( ambient9_t *ctx, uint8_t als_ps );
This example demonstrates the use of Ambient 9 Click board.
The demo application is composed of two sections :
Initializes the driver then reads the device status and part ID. If there's any error occured it displays an appropriate message on the USB UART. After that, it enables the device mode defined by the dev_mode variable. ALS mode is selected by default.
Depending on the selected device mode, it reads an ambient light sensor or proximity data and displays the results on the USB UART every 100ms.
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.