Use your forum account to login.

LOGIN

TOP Contributors

  1. MikroElektronika Team (436 codes)
  2. Shawon Shahryiar (246 codes)
  3. Alcides Ramos (96 codes)
  4. Dany (66 codes)
  5. O B (61 codes)
  6. MikroBUS.NET Team (35 codes)
  7. NART SCHINACKOW (34 codes)
  8. Alberto Trasimeni (25 codes)
  9. Roman Toropov (25 codes)
  10. Arezki YOUYOU (24 codes)

Most Downloaded

  1. Timer Calculator (77371 times)
  2. Network Ethernet Library (37711 times)
  3. FAT32 Library (36414 times)
  4. USB Device Library (28353 times)
  5. Network WiFi Library (27120 times)
  6. FT800 Library (19780 times)
  7. PID Library (18898 times)
  8. GSM click - Example (18497 times)
  9. microSD click - Example (15828 times)
  10. GPS click - Example (12694 times)
Libstock prefers package manager

Package Manager

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]

< Back
Library

Proximity 3 Click

Rating:

Author: MikroElektronika Team

Last Updated: 2017-11-10

Category: Measurement

Downloaded: 77 times

Not followed.

Proximity 3 click is an intelligent proximity and light sensing device, which features the VCNL4100 sensor from Vishay - high sensitivity long distance proximity sensor (PS), ambient light sensor (ALS) and 940 nm IRED, all in one small package.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Proximity 3 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Proximity 3 Click" changes.

Do you want to report abuse regarding "Proximity 3 Click".

  • Information
  • Comments (0)
Download

Download Library [1.84MB]

Version 1.0.0.0

DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Library Blog

Proximity 3 Click

Proximity 3 Click

Front and back view of the Proximity 3 click board.

View full image

Library Description

This library contains a set of functions, necessary to work with the Proximity 3 click.

Key functions

uint16_t prox3_readALS() - Reads value from ALS register

uint16_t prox3_readPS() - Reads value from PS register

uint16_t prox3_getDistance() - Calculating distance

uint16_t prox3_getIlluminance() - Calculating illuminance

Examples Description

This is a simple demonstration of sensor functionality, where the user can read the distance and illuminance data from Proximity 3 click. Distance and illuminance values are sent via UART.

The application is composed of three sections:

  • System Initialization - I2C and UART module initialization
  • Application Initialization - Sends HAL pointers, and initializes the VCNL4200
  • Application Task - Sequencial reading of the distance, proximity and ambient light data from the sensor and logging it to UART, every second
void applicationTask()
{
// DISTANCE READ AND CONVERT VALUE TO STRING
    resultPS = prox3_getDistance();
    IntToStr( resultPS, txt1 );
    
// WRITES INFORMATION TO UART
    UART1_Write_Text( "Proximity: ~ " );
    UART1_Write_Text( txt1 );
    UART1_Write_Text( " cmrn" );
    
// AMBIENT LIGHT READ AND CONVERT VALUE TO STRING
    resultALS = prox3_getIlluminance();
    IntToStr( resultALS, txt2 );

// WRITES INFORMATION TO UART
    UART1_Write_Text( "Ambient Light: " );
    UART1_Write_Text( txt2 );
    UART1_Write_Text( " luxrn" );
    
    Delay_ms(1000);
}

Other mikroE Libraries used in the example:

  • I2C
  • UART
  • Conversions

Additional notes and information

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.

ALSO FROM THIS AUTHOR

4x4 RGB click

4x4 RGB click carries a matrix of 16 RGB LEDs and a MCP1826 low dropout regulator. The LED matrix is connected to the target board microcontroller through the mikroBUS RST pin. The board uses either a 3.3V or 5V power supply.

[Learn More]

Utility Task Scheduler

Contains common utilities that are often implemented repetitively. This library contains a task scheduler. Incredibly handy for those systems doing multiple things. By using the libraries here, you save yourself some time and have the convenience of MikroCs' library management system.

[Learn More]

CapSense click - Example

This is a simple demonstration how CapSense click can be used. By pressing the CS button, LED below the button will be toggled ON and OFF. Swiping the finger over the slider will move the LED on portD LED array.

[Learn More]