Skip to content

setProximityHz()

Arnd edited this page Dec 31, 2016 · 2 revisions

SetProximityHz()

Proximity is measured with an IR transmitter and receiver on the VCNL4010. This function allows the scanning frequency to be adjusted from the default 1.95 measurements per second. The values range from 1.95 to 250 per second and whatever value is entered is rounded down to one of the following discrete values:

Binary Value Hertz Rate
000 1.95 measurements/s (DEFAULT)
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

Example:

VCNL4010 Sensor();  // Instantiate class    
...    
Sensor.setProximityHz(230);  // gets rounded down to 125Hz

Clone this wiki locally