We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-04-08
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Proximity
Downloaded: 3478 times
Not followed.
License: MIT license
Proximity 8 click is a close-range proximity sensing Click board, equipped with the VCNL36687S, a very accurate and power-efficient proximity sensor (PS) with VCSEL.
Do you want to subscribe in order to receive notifications regarding "Proximity 8 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Proximity 8 click" changes.
Do you want to report abuse regarding "Proximity 8 click".
Library Description
The library provides all the necessary functions for reading registers and writing data to the registers.
Key functions:
void proximity8_writeData(uint8_t reg, uint16_t dataIn)
- Function for writing data into the register.uint16_t proximity8_readData(uint8_t reg)
- Function for reads data from register.uint8_t proximity8_getInterruptState()
- Get interrupt state on the INT pin.Examples description
The application is composed of the three sections :
Note: The reading value and proximity of the data depend on the configuration.
void applicationTask()
{
uint16_t Proximity;
char demoText[ 50 ] = {0};
Proximity = proximity8_readData(_PROXIMITY8_REG_PROX_DATA);
Proximity = (Proximity & 0x7FFF);
IntToStr(Proximity, demoText);
mikrobus_logWrite(" Proximity data: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
mikrobus_logWrite("-------------------------", _LOG_LINE);
Delay_ms( 1500 );
}
Other mikroE Libraries used in the example:
I2C
UART
Conversions
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.