-
Notifications
You must be signed in to change notification settings - Fork 2
setProximityHz()
Proximity is measured with an IR transmitter and receiver on the VCNL4010. This function accepts an unsigned integer number representing the Hertz rate used to scan. The number entered is set to the closest actual internal setting which ranges from the default 1.95 measurements per second up to 250 measurements per second. The following table lists the discrete values used by the VCNL4010:
Binary Value |
Measurement frequency |
---|---|
000 | 1.95 measurements/s |
001 | 3.90625 measurements/s |
010 | 7.8125 measurements/s |
011 | 16.625 measurements/s |
100 | 31.25 measurements/s |
101 | 62.5 measurements/s |
110 | 125 measurements/s |
111 | 250 measurements/s |
VCNL4010 Sensor(); // Instantiate class
...
while(!Sensor.begin()); // loop until initialized
Sensor.setProximityHz(230); // gets rounded down to 125Hz
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