Skip to content

clearInterrupt()

Arnd edited this page Jan 1, 2017 · 1 revision

clearInterrupt([BitSettings])

This function will clear the interrupt settings. If no parameter is specified then all flags are cleared, but it is possible to just clear specific values by bit position as follows:

Bit Value
0 High Threshold reached
1 Low Threshold reached
2 Ambient light reading ready
3 Proximity reading ready

Example:

VCNL4010 Sensor();                              // Instantiate class    
...    
while (!Sensor.begin());                        // Initialize the VCNL4010
uint8_t interruptFlags = Sensor.getInterrupt(); // Get values
if(interruptFlags) {
  Sensor.clearInterrupt(B0011); // clear only threshold values if set
}