Address is changed to suit Grove Digital Light Sensor.
Fork of TSL2561_I2C by
Diff: TCS3472_I2C.h
- Revision:
- 1:70d7d9f1af01
- Parent:
- 0:453a43c8bf2b
- Child:
- 2:38d5187a4e7b
--- a/TCS3472_I2C.h Tue Mar 18 09:45:04 2014 +0000 +++ b/TCS3472_I2C.h Wed Mar 19 17:23:11 2014 +0000 @@ -2,21 +2,33 @@ #define TCS3472_I2C_H #include "mbed.h" +//Defines +#define SLAVE_ADDRESS 0x29 +#define ENABLE_REGISTER 0x00 +#define CDATA 0x14 +#define RDATA 0x16 +#define GDATA 0x18 +#define BDATA 0x1A + class TCS3472_I2C { public: TCS3472_I2C( PinName sda, PinName scl ); - - - - + + int getAllColours( int* readings ); + int getClearData(); + int getRedData(); + int getGreenData(); + int getBlueData(); + + char readEnableRegister(); private: I2C i2c_; - - - - - + + int enableRGBC(); + int writeSingleRegister( char address, char data ); + char readSingleRegister( char address ); + int readMultipleRegisters( char address, char* output, int quantity ); }; -#endif TCS3472_I2C_H \ No newline at end of file +#endif \ No newline at end of file