Skip to content

setAmbientLight()

Arnd edited this page Dec 31, 2016 · 3 revisions

setAmbientLight()

This function sets the sample rate and averaging for the ambient light measurements. The first parameter is the sampling rate, which ranges from 1 to 10 samples per second. The second parameter is the number of readings used to compute the value, the averaging ranges from 1 to 128 in powers of 2 (i.e. 1,2,4,8,...128) and the parameter value passed in is rounded down to the closest value.


Example:

VCNL4010 Sensor();  // Instantiate class    
...    
Sensor.setAmbientLight(4,32); // sample 4 times per second and average 32 readings 

Clone this wiki locally