How do I change TCS34725 address?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- warren631
- Posts: 5
- Joined: Mon Sep 01, 2014 12:45 pm
How do I change TCS34725 address?
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.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: How do I change TCS34725 address?
The device has a fixed address. If you want to run 2, you would need to use "Softi2c".
http://playground.arduino.cc/Main/SoftwareI2CLibrary
http://playground.arduino.cc/Main/SoftwareI2CLibrary
- warren631
- Posts: 5
- Joined: Mon Sep 01, 2014 12:45 pm
Re: How do I change TCS34725 address?
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.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: How do I change TCS34725 address?
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.
- warren631
- Posts: 5
- Joined: Mon Sep 01, 2014 12:45 pm
Re: How do I change TCS34725 address?
Another solution I found is to use an I2C multiplexer like this: http://www.dsscircuits.com/index.php/i2c-multiplexer
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: How do I change TCS34725 address?
That is certainly a valid solution. But it still requires additional address pins, and code to select between them.
Please be positive and constructive with your questions and comments.