proximity11 2.0.0.0
|
Proximity 11 Click is a close-range proximity sensing Click boardâ„¢, equipped with the RPR-0521RS, a very accurate and power-efficient proximity and ambient Light Sensor with IrLED.
We provide a library for the Proximity11 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 Proximity11 Click driver.
- Initialization function.void proximity11_cfg_setup ( proximity11_cfg_t *cfg );
PROXIMITY11_RETVAL proximity11_init ( proximity11_t *ctx, proximity11_cfg_t *cfg );
void proximity11_default_cfg ( proximity11_t *ctx );
- This function updates data used to calculate Lux. This function should be called if changing als measurement time and als gain.uint8_t proximity11_get ( proximity11_t *ctx, uint8_t register_address, uint8_t *output_buffer, uint8_t n_bytes );
void proximity11_update ( proximity11_t *ctx );
void proximity11_set_als_threshold_high ( proximity11_t *ctx, uint16_t threshold_value );
This appication enables usage of the proximity and ambient light sensors
The demo application is composed of two sections :
Initializes I2C driver and performs device initialization
Gets ALS and PS values and logs those values
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.