Arduino_APDS9960 - proximityAvailable()

Check if a proximity reading is available from the senor. The proximity reading can be retrieved using the APDS.readProximity() function. This function also enables the proximity sensor when called for the first time.

Syntax

APDS.proximityAvailable()

Parameters

None.

Returns

1 if a proximity has been read, otherwise 0

Example

// Check if a proximity reading is available.
if (APDS.proximityAvailable()) {
    int proximity = APDS.readProximity();
    Serial.println(proximity);
}

See also