src/APDS9930.cpp
bool APDS9930::setLEDDrive(uint8_t drive)
{
    uint8_t val;
    
    /* Read value from CONTROL register */
    if( !wireReadDataByte(APDS9930_CONTROL, val) ) {
        return false;
    }
    
    /* Set bits in register to given value */
    drive &= 0b00000011;
    drive = drive << 6;
    val &= 0b00111111;
    val |= drive;
    
    /* Write register value back into CONTROL register */
    if( !wireWriteDataByte(APDS9930_CONTROL, val) ) {
        return false;
    }
    
    return true;
}
/**
 * @brief Sets the LED drive strength for proximity and ALS
 *
 * Value    LED Current
 *   0        100 mA
 *   1         50 mA
 *   2         25 mA
 *   3         12.5 mA
 *
 * @param[in] drive the value (0-3) for the LED drive strength
 * @return True if operation successful. False otherwise.
 */
@brief Sets the LED drive strength for proximity and ALS
Value    LED Current
0        100 mA
1         50 mA
2         25 mA
3         12.5 mA

@param[in] drive the value (0-3) for the LED drive strength
@return True if operation successful. False otherwise.
@brief Sets the LED drive strength for proximity and ALS Value LED Current 0 100 mA 1 50 mA 2 25 mA 3 12 . 5 mA @param [ in ] drive the value ( 0 - 3 ) for the LED drive strength @return True if operation successful . False otherwise .
bool APDS9930::setLEDDrive(uint8_t drive)
{
    uint8_t val;
    if( !wireReadDataByte(APDS9930_CONTROL, val) ) {
        return false;
    }
    drive &= 0b00000011;
    drive = drive << 6;
    val &= 0b00111111;
    val |= drive;
    if( !wireWriteDataByte(APDS9930_CONTROL, val) ) {
        return false;
    }
    return true;
}
bool APDS9930 :: setLEDDrive ( uint8_t drive ) { uint8_t val ; if ( ! wireReadDataByte ( APDS9930_CONTROL , val ) ) { return false ; } drive &= 0b00000011 ; drive = drive << 6 ; val &= 0b00111111 ; val |= drive ; if ( ! wireWriteDataByte ( APDS9930_CONTROL , val ) ) { return false ; } return true ; }
@brief Sets the LED drive strength for proximity and ALS
 Value    LED Current
   0        100 mA
   1         50 mA
   2         25 mA
   3         12.5 mA
@brief Sets the LED drive strength for proximity and ALS Value LED Current 0 100 mA 1 50 mA 2 25 mA 3 12 . 5 mA
/* Read value from CONTROL register */ /* Set bits in register to given value */ /* Write register value back into CONTROL register */