-
Notifications
You must be signed in to change notification settings - Fork 2
setAmbientContinuous()
The VCNL4010 defaults to a mode where a measurement for the Ambient (and Proximity) needs to be triggered explicitly by the program before sampling is performed. This function, when called with a parameter value of "true", enables the continuous background measurement mode of the VCNL4010 where readings are automatically performed rather than triggered manually. Setting the value to "false" reverts the system back to normal mode.
This mode is particularly useful when the VCNL4010 is used to trigger interrupts. With this mode set and an alarm threshold for minimum and/or maximum values enabled using the SetInterrupt() function the controlling Arduino can be processing other items asynchronously or even put to sleep while measurements are taking place in the background.
VCNL4010 Sensor(); // Instantiate class
...
while(!Sensor.begin()); // loop until initialized
Sensor.setAmbientContinuous(true); // Continuously sample ambient using frequency and averaging settings
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