Basic library for the TCS34725, based off of several example programs and the Adafruit Arduino library
Dependents: MF_FUJIKO_BASE STEM_2019 STEM_2020
Diff: TCS34725.cpp
- Revision:
- 4:41f1acad69e5
- Parent:
- 3:afb107db7994
--- a/TCS34725.cpp Wed Jan 25 20:17:57 2017 +0000 +++ b/TCS34725.cpp Wed Mar 22 20:54:37 2017 +0000 @@ -47,11 +47,11 @@ init(intTime,gain); } -void TCS34725::getColor(uint16_t *r, uint16_t *g, uint16_t *b, uint16_t *c){ - *c = i2cRead16(SENSOR_ADDR, TCS34725_CDATAL); - *r = i2cRead16(SENSOR_ADDR, TCS34725_RDATAL); - *g = i2cRead16(SENSOR_ADDR, TCS34725_GDATAL); - *b = i2cRead16(SENSOR_ADDR, TCS34725_BDATAL); +void TCS34725::getColor(uint16_t &r, uint16_t &g, uint16_t &b, uint16_t &c){ + c = i2cRead16(SENSOR_ADDR, TCS34725_CDATAL); + r = i2cRead16(SENSOR_ADDR, TCS34725_RDATAL); + g = i2cRead16(SENSOR_ADDR, TCS34725_GDATAL); + b = i2cRead16(SENSOR_ADDR, TCS34725_BDATAL); switch(t_intTime){ case TCS34725_INTEGRATIONTIME_2_4MS: wait(0.003);