Hello!
I bought two 16x2 RGB shields and thought i could make them work separately. I used a little program to search the IC2 bus for addresses but it only finds one address: 0x20. With only 1 address on the bus and when attached both shields to the SDA and SCL pins, whenever i send a command it does the same thing on both LCDs.
Is there any way to change the address of the shields in order to talk to them separately?
You can see my setup on the image below:
Note: The SDA (yellow) and SCL (blue) cables are not connected to the arduino in this photo. I have them connected now.
Ill try to add another photo soon showing both LCDs displaying the same thing.
Thanks! (:
16x2 RGB Shield Address change?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88092
- Joined: Sat Feb 07, 2009 10:11 am
Re: 16x2 RGB Shield Address change?
The shield uses the default address for the MCP23017 i2c port expander chip. The chip does have 3 address pins and it is possible to re-address the shield with a bit of hacking.
Here are the links to the schematics and data sheets. The address pins (15, 16 & 17) are currently all tied to GND. You can pull one or more of them high with a jumper to change the address.
https://github.com/adafruit/Adafruit-RGB-LCD-shield
http://www.adafruit.com/datasheets/mcp23017.pdf
Here are the links to the schematics and data sheets. The address pins (15, 16 & 17) are currently all tied to GND. You can pull one or more of them high with a jumper to change the address.
https://github.com/adafruit/Adafruit-RGB-LCD-shield
http://www.adafruit.com/datasheets/mcp23017.pdf
- rodcar125
- Posts: 9
- Joined: Tue Mar 11, 2014 11:02 pm
Re: 16x2 RGB Shield Address change?
Great, I'll give it a try and report back
Thanks a lot!
Rodrigo
Thanks a lot!
Rodrigo
- rodcar125
- Posts: 9
- Joined: Tue Mar 11, 2014 11:02 pm
Re: 16x2 RGB Shield Address change?
Hi again,
Maybe this is a silly question but do i just connect a 5V cable to any of the pin number 15, 16 or 17? does the shield has specific pins i could connect them to? i reviewed the schematic you posted searching for the pin from the IC to the board but i can figure it out ):
Thanks again!
Maybe this is a silly question but do i just connect a 5V cable to any of the pin number 15, 16 or 17? does the shield has specific pins i could connect them to? i reviewed the schematic you posted searching for the pin from the IC to the board but i can figure it out ):
Thanks again!
- adafruit_support_bill
- Posts: 88092
- Joined: Sat Feb 07, 2009 10:11 am
Re: 16x2 RGB Shield Address change?
The pins now are connected to ground. If you just connect 5v to it, you will create a short circuit. You need to cut the pin where it is soldered to the shield, bend it out away from the board, then solder a jumper from it to 5v.
- rodcar125
- Posts: 9
- Joined: Tue Mar 11, 2014 11:02 pm
Re: 16x2 RGB Shield Address change?
Really glad I asked before doing something stupid!
I have desoldered the pin 15 from the board and solder a jumper to that pin. I added a couple drops of hot silicone for support since the leg its too weak. Ill try it as soon as i get home (:
I suppose ill have to create two different instances of the Adafruit_RGBLCDShield for the LCDs right?
something like:
I have desoldered the pin 15 from the board and solder a jumper to that pin. I added a couple drops of hot silicone for support since the leg its too weak. Ill try it as soon as i get home (:
I suppose ill have to create two different instances of the Adafruit_RGBLCDShield for the LCDs right?
something like:
Code: Select all
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
Adafruit_RGBLCDShield lcd2 = Adafruit_RGBLCDShield();
- rodcar125
- Posts: 9
- Joined: Tue Mar 11, 2014 11:02 pm
Re: 16x2 RGB Shield Address change?
I connected everything and ran the I2C scanner...
Awesome!!
Now ill try to figure out how to talk to each one.
Thanks a lot Bill!!
Awesome support team
Awesome!!
Now ill try to figure out how to talk to each one.
Thanks a lot Bill!!
Awesome support team
- mikel_hubo
- Posts: 3
- Joined: Wed Mar 04, 2015 12:56 pm
Re: 16x2 RGB Shield Address change?
Hi,
had the same adress conflict and solved it to 20 and 22
Where in the driver software do I have to change the adress to 22 now ?
thx for helping
mikel
had the same adress conflict and solved it to 20 and 22
Where in the driver software do I have to change the adress to 22 now ?
thx for helping
mikel
- adafruit_support_bill
- Posts: 88092
- Joined: Sat Feb 07, 2009 10:11 am
Re: 16x2 RGB Shield Address change?
On line 119 of Adafruit_RGBLCDShield.cpp
To change from 20 (the default) to 22, change:
To:
To change from 20 (the default) to 22, change:
Code: Select all
_i2c.begin();
Code: Select all
_i2c.begin(2);
- mikel_hubo
- Posts: 3
- Joined: Wed Mar 04, 2015 12:56 pm
Re: 16x2 RGB Shield Address change?
Hi and thanks for the quik answer.
I got a next one question on this,
where do I find the source code of Adafruit_RGBLCDShield.cpp
thx for helping
mikel
I got a next one question on this,
where do I find the source code of Adafruit_RGBLCDShield.cpp
thx for helping
mikel
- adafruit_support_bill
- Posts: 88092
- Joined: Sat Feb 07, 2009 10:11 am
Re: 16x2 RGB Shield Address change?
The library code is here in github:
https://github.com/adafruit/Adafruit-RG ... ld-Library
https://github.com/adafruit/Adafruit-RG ... ld-Library
- mikel_hubo
- Posts: 3
- Joined: Wed Mar 04, 2015 12:56 pm
Re: 16x2 RGB Shield Address change?
Thanks a lot !
Please be positive and constructive with your questions and comments.