Arduino_APDS9960 - colorAvailable()

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

Syntax

APDS.colorAvailable()

Parameters

None.

Returns

1 if a color has been read, otherwise 0.

Example

// Check if a color reading is available.
if (APDS.colorAvailable()) {
    int r, g, b;

    // Read the color.
    APDS.readColor(r, g, b);
}

See also