-
Notifications
You must be signed in to change notification settings - Fork 2
getInterrupt()
Arnd edited this page Dec 11, 2020
·
2 revisions
This function retrieves the values of the interrupt status register. If the returned unsigned integer is 0 then no interrupts are pending, any other value means that one or more interrupts are set. The values are set by bit position as follows:
Bit | Value |
---|---|
0 | High Threshold reached |
1 | Low Threshold reached |
2 | Ambient light reading ready |
3 | Proximity reading ready |
The interrupt settings remain until cleared using the clearInterrupt() function.
VCNL4010 Sensor(); // Instantiate class
...
while (!Sensor.begin()); // Initialize the VCNL4010
uint8_t interruptFlags = Sensor.getInterrupt(); // Get values
if(interruptFlags|B0001) Serial.print("High threshold set");
if(interruptFlags|B0010) Serial.print("Low threshold set");
if(interruptFlags|B0100) Serial.print("Ambient sample ready");
if(interruptFlags|B1000) Serial.print("Proximity sample ready");
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