2
\$\begingroup\$

I have 3, 4-Digit 7-Segment Displays from Adafruit, and the included docs/ libraries say I should connect the display to pins A4 & A5. However, I have three of the displays, so I am looking for a way to connect one to pins A1 & A2, another to A2 & A3, and the 3rd to A4 & A5. I've looked through the included docs/libraries, but I can't seem to figure out what to change in my code or the libraries.

Here is the code I use to initalize them:

Adafruit_7segment matrix = Adafruit_7segment();

I'm hoping for a solution in the form of:

    Adafruit_7segment matrix1 = Adafruit_7segment(1); 
    Adafruit_7segment matrix2 = Adafruit_7segment(2);

or something similar.

\$\endgroup\$
1
  • \$\begingroup\$ I edited in more below to try to help you out, but I don't know c++! \$\endgroup\$ Sep 20, 2012 at 21:43

1 Answer 1

3
\$\begingroup\$

I see that this has an I2C driver! You shouldn't need to route each display to 2 I/O pins and set up three separate I2C busses. There's a jumper to change the address on the board. Just daisy-chain the SDA and SCL lines (making sure that there's a pull-up resistor somewhere if they're not already on the boards), and talk to each one in your code through its unique address. You might need to edit that function you're calling to pass an address as an argument-- maybe an Arduino user can post good instructions on how to do that.

To be a bit clearer, use the on-board jumper to give each display its own unique I2C address, and edit the function to include an address argument that specifies which display you're talking to.

UPDATE: http://forums.adafruit.com/viewtopic.php?f=47&t=29774

check out the example there. I don't speak C++, so I'm really going to embarrass myself here to try to help you out, but I think somewhere you need

matrix1.begin(0x70);  // Start up the  LCD matrixes
matrix2.begin(0x71);

The hex numbers will change according to how you've hardware-defined your display addresses.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks!. This seems like the right track. Can you clarify what I should connect to what. SDA1 to arduino, SCL1 to SDA2, or whatever. Thanks! \$\endgroup\$
    – Andrew
    Sep 12, 2012 at 15:11
  • \$\begingroup\$ I've never used an Arduino, but the SDA and SCL are bussed. One of the arduino pins (either a4 or a5, I can't tell which) will go to the pad labelled "SCL" on all the boards , and the other pin would go to the pad labelled "SDA". It looks like there are already pull-up resistors in place, which might be a problem because the parallel combination would result in a low value, but this prbably won't be an issue. It looks like the pads labelled A0 through A2 are going to be used to set the address somehow that the documentation will tell you about \$\endgroup\$ Sep 12, 2012 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.