I2C - Multiple 7 Segment Displays

Hello,

I'm looking at using a couple 7 Segment Displays on a project, and I've found an example to get one of them to display a timer. When I connect the second display, it shows the same values, thus meaning they are on the same address.

I have a Redboard/Uno that I'm using with qty. 2 - 7 segment displays at this point and am not sure how to go about changing one address so that I can have both of them displaying two different things.

Do I disconnect one display, and run a sketch that changes the address configuration, then connect them all together with updated sketches that address them individually?

There are a lot of 7 segment displays. Can you post a data sheet or a link to where you got it?
How is the display interfaced?

Post the code that you have.

Read the how to use this forum-please read sticky to see how to properly post code and some advice on how to ask an effective question. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code.

A lot of I2C devices have jumpers to set the address, post a link for your display.

This is the Display I'm using

You did not answer my question about the interface. I will assume I2C cause you want to change the address.

Here is how to change the address. I would write a short program to send the address change command and using software serial. Connect the display that you want to change to the software serial port and send the command (and the new address). Once changed the address is stored in non volatile memory so will remain.

Thank you

Yes, I was looking at I2C interfacing.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Ok, so I believe I’ve managed to re-address one of my displays so now when I upload a I2C scanner sketch, it reads back 0x01 for one of my displays, and 0x71 for the other.

I’ve tried using the 0x81 command over serial to try and clear everything on both displays, but it doesn’t seem to help. My display is currently stuck showing the last counter time and isn’t clearing the display with the 0x76 command. Below is what I was trying to use to clear my display and reset it, but something isn’t right.

I’m not sure if you can leave the bus intact and clear multiple devices at once, or if you have to clear/reset them individually.

#include <Wire.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
Serial.write(0x81);
Serial.write(0x76);
}

Hahaha, well now I'm a bit confused...

With my last post, I let the Arduino sit for a little while with the display still plugged in and glaring the red "0127" digits at my face of defeat.

After a few moments, the display changed to "0000", and so I merely thought it was extremely delayed. So I figured I'd check the I2C scanner sketch and see what the address changed to. I guess when the "0x81" command was sent, I thought it was factory reset of the display and was expecting it to return to address "0x71". However, it is now "0x08".

Is this a normal response? Just seems odd to me

I would suggest that you put the displays on a software serial port. If connected to the hardware serial port (Serial, USB) it may be that during program upload that the displays are getting what they think are valid commands with unpredictable results.

The I2C address has no effect when you are using serial to control the displays. If you want independent serial displays, you will need a serial port for each.

Serial and I2C are two different protocols.

I2C uses the Wire library to send commands.

Hi,
Please read post #6.

Thanks.. Tom.. :slight_smile: