-
Notifications
You must be signed in to change notification settings - Fork 2
setAmbientLight()
This function sets the tunables for the ambient light sensor (ALS). Two values can be set, the first is the "SampleRate" which is the number of samples collected per second. This ranges from 1 to 10 samples per second with a default value of 2, and is only used when continuous sampling is enabled using the SetAmbientContinuous() function. The second parameter is the number of averages taken per reading, which ranges from 1 to 128 (the internal sample rate setting only uses powers of 2, e.g. 1, 2, 4, ... 128). This setting applies to the normal request-conversion sampling mode as well as to the automated continuous sampling mode linked to above.
VCNL4010 Sensor(); // Instantiate class
...
while(!Sensor.begin()); // loop until initialized
Sensor.setAmbientLight(4,32); // 4/s samples, 32 readings averaged together
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