-
Notifications
You must be signed in to change notification settings - Fork 2
DisplayMeasurements.ino
Arduino sketch to read and display measurements from the Vishay VCNL4010 sensor.
No special processor-dependent calls are used and thus this sketch should run on any of the Arduino systems. The serial port speed defaults to 115200 baud.
The VCNL4010 is initialised in the setup() method with the following explicit values:
- The LED proximity sensor is boosted to 200mA for greater sensitivity and distance
- Ambient light sensor set to sample 2 times per second with 128 averages per reading
- Proximity sensor set to sample 128 times per second
After initialisation the program loops infinitely. It displays the time in milliseconds, the ambient light reading and the proximity reading when either of the sensor readings changes by more than 15% from the last reading.
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