TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136673 times)
  2. FAT32 Library (69912 times)
  3. Network Ethernet Library (55925 times)
  4. USB Device Library (46253 times)
  5. Network WiFi Library (41882 times)
  6. FT800 Library (41132 times)
  7. GSM click (28973 times)
  8. PID Library (26407 times)
  9. mikroSDK (26350 times)
  10. microSD click (25351 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
mikroSDK Library

Proximity 5 click

Rating:

5

Author: MIKROE

Last Updated: 2018-04-10

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Proximity

Downloaded: 4360 times

Not followed.

License: MIT license  

Proximity 5 click is a very accurate and reliable proximity sensing (PS) and ambient light sensing (ALS) device, equipped with the state-of-the-art PS and ALS sensor.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Proximity 5 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Proximity 5 click" changes.

Do you want to report abuse regarding "Proximity 5 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
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 FT90x
  • 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
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 FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC 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 FT90x
  • 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

mikroSDK Library Blog

Proximity 5 click

Proximity 5 click

Native view of the Proximity 5 click board.

View full image
Proximity 5 click

Proximity 5 click

Front and back view of the Proximity 5 click board.

View full image

Library Description

This library provides generic functions for working with the Click board.

Key functions:

  • void proximity5_init() - Main initialization function for the Click board.
  • void proximity5_getValues(uint16_t *proxVal) - Function for returning proximity values from the Click board.

Examples Description

The application is composed of three sections:

  • System Initialization - Initializes GPIO, I2C and log structures.
  • Application Initialization -  Configures the microcontroller for communication
    and initializes the Click board.
  • Application Task - (code snippet) -The proximity data is read from the sensor and it is printed to the UART.
void applicationTask()
{
 char text[10];
 proximity5_getValues(&bff);

 mikrobus_logWrite("PS1 ",_LOG_TEXT);
 WordToStr(bff[0],text);
 mikrobus_logWrite(text,_LOG_LINE);

 mikrobus_logWrite("PS2 ",_LOG_TEXT);
 WordToStr(bff[1],text);
 mikrobus_logWrite(text,_LOG_LINE);

 mikrobus_logWrite("PS3 ",_LOG_TEXT);
 WordToStr(bff[2],text);
 mikrobus_logWrite(text,_LOG_LINE);

 Delay_ms(500);
}

Other mikroE Libraries used in the example:

  • I2C Library
  • UART Library
  • Conversions Library
  • C_String Library

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

Tilt 2 click

5

Tilt 2 click is a tilt sensor switch, which breaks the circuit when tilted to an angle of 45° or when shaken. It is a single-pole-double-throw type of switch (SPDT), which can be operated with up to 24V. The current through the switch should not exceed 25mA.

[Learn More]

Accel 2 click

0

Accel 2 click carries ST’s LIS3DSH IC, a low-power factory-calibrated three-axis accelerometer which embeds a FIFO buffer and two programmable state machines.

[Learn More]

Thermo 4 click

7

THERMO 4 click carries the LM75A digital temperature sensor and thermal watchdog. The sensor has the range from −55 °C to +125 °C. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over I2C interface

[Learn More]