Skip to content

setProximityFreq()

Arnd edited this page Jan 1, 2017 · 2 revisions

SetProximityFreq([FreqKey])

Proximity is measured with an IR transmitter and receiver pair on the VCNL4010. This function allows the frequency of the IR square wave to be adjusted from among 5 discrete device values as follows:

Binary
Value
Frequency
000 390.625 kHz
001 781.25 kHz
010 1.5625 MHz
011 3.125 MHz

Example:

VCNL4010 Sensor();          // Instantiate class    
...    
while(!Sensor.begin());     // loop until initialized
Sensor.setProximityFreq(2); // set frequency to 1.5625MHz