For use with STM32L746RG . Class which provides functions to control a TAOS TCS3472 Color Light-to-Digital Converter with IR Filter via I2C.
Fork of TCS3472_I2C by
Diff: TCS3472_I2C.cpp
- Revision:
- 8:764a98777c11
- Parent:
- 7:ab9ff8738826
diff -r ab9ff8738826 -r 764a98777c11 TCS3472_I2C.cpp --- a/TCS3472_I2C.cpp Sun Apr 30 08:00:52 2017 +0000 +++ b/TCS3472_I2C.cpp Thu Jun 01 08:04:39 2017 +0000 @@ -9,6 +9,12 @@ } +bool TCS3472_I2C::verifyConnection(void) { + uint8_t part_id = readSingleRegister(0x12);//ID + if (part_id == 0x44) + return true; + return false; +} int TCS3472_I2C::writeSingleRegister( char address, char data ){ char tx[2] = { address | 160, data }; //0d160 = 0b10100000 int ack = i2c.write( SLAVE_ADDRESS << 1, tx, 2 );