How do I change TCS34725 address?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
warren631
 
Posts: 5
Joined: Mon Sep 01, 2014 12:45 pm

How do I change TCS34725 address?

Post by warren631 »

Hi Guys. I need to connect two TCS34725 color sensors to a Mega. How do I change the I2C address in the TCS34725's so I can have two different I2C addresses. I guess I will have to also change the Adafruit TCS34725 library to a variable address. Thanks for any help.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: How do I change TCS34725 address?

Post by adafruit_support_bill »

The device has a fixed address. If you want to run 2, you would need to use "Softi2c".
http://playground.arduino.cc/Main/SoftwareI2CLibrary

User avatar
warren631
 
Posts: 5
Joined: Mon Sep 01, 2014 12:45 pm

Re: How do I change TCS34725 address?

Post by warren631 »

Thanks Support. Even with a software driver I don't understand how I can communicate with two devices with the same address. Should use "Softi2c" to create two separate I2C busses from the Mega? How are they separated in code if both addresses are the same. Are there any code examples? I already have one I2C bus connected to a compass using the Wires library. A fixed address seems very limiting. Seems to be defeating the purpose of the I2C bus system.
Last edited by warren631 on Mon Sep 01, 2014 3:31 pm, edited 1 time in total.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: How do I change TCS34725 address?

Post by adafruit_support_bill »

You can use the hardware i2c bus for one of them, and a softi2c bus for the other. It is a shame that some manufacturers don't provide addressability for their i2c devices.

User avatar
warren631
 
Posts: 5
Joined: Mon Sep 01, 2014 12:45 pm

Re: How do I change TCS34725 address?

Post by warren631 »

Another solution I found is to use an I2C multiplexer like this: http://www.dsscircuits.com/index.php/i2c-multiplexer

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: How do I change TCS34725 address?

Post by adafruit_support_bill »

That is certainly a valid solution. But it still requires additional address pins, and code to select between them.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”