Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TCS3472_I2C by
Revision 8:764a98777c11, committed 2017-06-01
- Comitter:
- Allar
- Date:
- Thu Jun 01 08:04:39 2017 +0000
- Parent:
- 7:ab9ff8738826
- Commit message:
- night;
Changed in this revision
| TCS3472_I2C.cpp | Show annotated file Show diff for this revision Revisions of this file | 
| TCS3472_I2C.h | Show annotated file Show diff for this revision Revisions of this file | 
--- 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 );
--- a/TCS3472_I2C.h	Sun Apr 30 08:00:52 2017 +0000
+++ b/TCS3472_I2C.h	Thu Jun 01 08:04:39 2017 +0000
@@ -336,6 +336,8 @@
     char readStatusRegister();
 
     int calculateColorTemperature(int r, int g, int b);
+    
+    bool verifyConnection(void);
 
 float calculateChromaticityX(int r, int g, int b);
 float calculateChromaticityY(int r, int g, int b);
    