proximity6
2.0.0.0
|
Proximity 6 click is a versatile proximity detection device on a Click boardâ„¢.
We provide a library for the Proximity6 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 Proximity6 Click driver.
void proximity6_cfg_setup ( proximity6_cfg_t *cfg );
PROXIMITY6_RETVAL proximity6_init ( proximity6_t *ctx, proximity6_cfg_t *cfg );
void proximity6_default_cfg ( proximity6_t *ctx );
uint8_t proximity6_read_data ( proximity6_t *ctx, uint16_t *axis_out );
proximity6_get_position( proximity6_t *ctx, uint8_t *position );
uint8_t proximity6_display_data( proximity6_t *ctx, uint8_t *data_value, uint8_t set_resolution );
This application can detect the proximity of an object via sensor and can show the results of proximity as a graphic view, or show the position of the object.
The demo application is composed of two sections :
Sets the registers in default state and configures the device to work in proper operating mode (Proximity Mode).
Example can show the data register values as graphic view in desired resolution. Also can determine from which side the object (body) affects on the sensor and logs results on USB UART. Results will be shown only when one or more data registers are updated with the new value (sensor detects the change).
void proximity6_logGraphicRes() - Function loggs on USB UART results from the data proximity registers as graphic view. void proximity6_logPositionRes() - Function loggs on USB UART the position of the object which affects of the sensor.
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.