APDS-9960 Light, RGB, Proximity, and Gesture Sensor https://www.sparkfun.com/products/12787 This library interfaces the APDS-9960 to Mbed over I2C. The library relies on the I2C library. To use the library, instantiate a glibr object, call ginit(), and call the appropriate functions.
Dependents: Gesture_User_Interface car_test_v1 Capt_couleur_CAN Capt_couleur_smart
Fork of APDS_9960 by
Diff: glibr.cpp
- Revision:
- 2:ba051af6731a
- Parent:
- 0:1aac12a5f1e0
--- a/glibr.cpp Thu Mar 12 21:12:45 2015 +0000 +++ b/glibr.cpp Mon Apr 27 02:05:49 2015 +0000 @@ -31,7 +31,7 @@ return false; } - if(!setMode(ALL, OFF)) { + if(!setMode(ALL, Off)) { return false; } if(I2CwriteByte(APDS9960_I2C_ADDR,APDS9960_ATIME, DEFAULT_ATIME)){ @@ -164,7 +164,7 @@ * @brief Enables or disables a feature in the APDS-9960 * * @param[in] mode which feature to enable - * @param[in] enable ON (1) or OFF (0) + * @param[in] enable On (1) or Off (0) * @return True if operation success. False otherwise. */ bool glibr::setMode(uint8_t mode, uint8_t enable) @@ -541,7 +541,7 @@ */ bool glibr::enablePower() { - if( !setMode(POWER, 1) ) { + if( !setMode(Power, 1) ) { return false; } @@ -555,7 +555,7 @@ */ bool glibr::disablePower() { - if( !setMode(POWER, 0) ) { + if( !setMode(Power, 0) ) { return false; } @@ -591,7 +591,6 @@ return false; } val = val + ((uint16_t)val_byte << 8); - return true; } @@ -1660,7 +1659,7 @@ * * * -*LEFT OFF HERE AT 3:47PM ON 3/6/15 +*LEFT Off HERE AT 3:47PM On 3/6/15 * * *