-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Arduino library for using the Vishay VCNL4010 sensor. The sensor is a fully integrated proximity and ambient light sensor with infrared emitter, I2C interface and interrupt function in a small package. It is available as a breakout board from Adafruit at https://www.adafruit.com/product/466. The VCNL4010 datasheet can be found at http://www.vishay.com/docs/83462/vcnl4010.pdf.
The ambient light sensor (ALS) return a 16-bit value starting at close to 0 for no light and goes upwards as the light level increases.
The proximity sensor has a range of approximately 200mm (2 cm, or 3/4 of an inch) and goes from 65536 when the closest reflector is touching the device to a value of around 2000 when nothing is being reflected in range.
Overview
Installation
Class Instantiation
begin()
setProximityHz()
setLEDmA()
setProximityFreq()
setAmbientLight()
setAmbientContinuous()
setProximityContinuous()
setInterrupt()
getAmbientLight()
getProximity()
getInterrupt()
clearInterrupt()
readByte() (advanced)
readWord() (advanced)
writeByte() (advanced)
-none-
CheckDistance.ino
DisplayMeasurements.ino
RegressionTests.ino
WakeOnInterrupt.ino