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.
APDS.proximityAvailable()
None.
1 if a proximity has been read, otherwise 0
// Check if a proximity reading is available.
if (APDS.proximityAvailable()) {
int proximity = APDS.readProximity();
Serial.println(proximity);
}