src/APDS9930.cpp
bool APDS9930::enableProximitySensor(bool interrupts)
{
    /* Set default gain, LED, interrupts, enable power, and enable sensor */
    if( !setProximityGain(DEFAULT_PGAIN) ) {
        return false;
    }
    if( !setLEDDrive(DEFAULT_PDRIVE) ) {
        return false;
    }
    if( interrupts ) {
        if( !setProximityIntEnable(1) ) {
            return false;
        }
    } else {
        if( !setProximityIntEnable(0) ) {
            return false;
        }
    }
    if( !enablePower() ){
        return false;
    }
    if( !setMode(PROXIMITY, 1) ) {
        return false;
    }
    
    return true;
}
/**
 * @brief Starts the proximity sensor on the APDS-9930
 *
 * @param[in] interrupts true to enable hardware external interrupt on proximity
 * @return True if sensor enabled correctly. False on error.
 */
@brief Starts the proximity sensor on the APDS-9930
@param[in] interrupts true to enable hardware external interrupt on proximity
@return True if sensor enabled correctly. False on error.
@brief Starts the proximity sensor on the APDS - 9930 @param [ in ] interrupts true to enable hardware external interrupt on proximity @return True if sensor enabled correctly . False on error .
bool APDS9930::enableProximitySensor(bool interrupts)
{
    if( !setProximityGain(DEFAULT_PGAIN) ) {
        return false;
    }
    if( !setLEDDrive(DEFAULT_PDRIVE) ) {
        return false;
    }
    if( interrupts ) {
        if( !setProximityIntEnable(1) ) {
            return false;
        }
    } else {
        if( !setProximityIntEnable(0) ) {
            return false;
        }
    }
    if( !enablePower() ){
        return false;
    }
    if( !setMode(PROXIMITY, 1) ) {
        return false;
    }
    return true;
}
bool APDS9930 :: enableProximitySensor ( bool interrupts ) { if ( ! setProximityGain ( DEFAULT_PGAIN ) ) { return false ; } if ( ! setLEDDrive ( DEFAULT_PDRIVE ) ) { return false ; } if ( interrupts ) { if ( ! setProximityIntEnable ( 1 ) ) { return false ; } } else { if ( ! setProximityIntEnable ( 0 ) ) { return false ; } } if ( ! enablePower ( ) ) { return false ; } if ( ! setMode ( PROXIMITY , 1 ) ) { return false ; } return true ; }
@brief Starts the proximity sensor on the APDS-9930
 @param[in] interrupts true to enable hardware external interrupt on proximity
 @return True if sensor enabled correctly.
@brief Starts the proximity sensor on the APDS - 9930 @param [ in ] interrupts true to enable hardware external interrupt on proximity @return True if sensor enabled correctly .
/* Set default gain, LED, interrupts, enable power, and enable sensor */