7segment led display

hi all,

I am trying to write the code to display some number to 2 digit 7 segment led. I am be able to display to one digit led, but I do not know how to display to dual digits. any helps would be appreciated very much.

for example: display some number 3.9, 3.5, 1.0

thanks in advance.

Before we can offer at help we have to know how it is wired up. This is because there are many ways to wire this up and it affects the code. Please post a schematic.

hi all,

I forgot to mention that I am using dual 7-segment from Lite-On (part # LTD-4608JF). Thanks.

Try checking out the product datasheet (I Googled the part# and found this : http://optoelectronics.liteon.com/upload/download/DS30-2001-317/P_100_D4608JF.pdf ) to know how you can connect the display to your Arduino.

To make both the digits work you will have to use something called "multiplexing"; it is simply a method of controlling many outputs using less pins. The same technique is used to control LED matrices. For example if you wanted to control each LED in an 8x8 LED matrix, you would need 64 pins, but if you use multiplexing you can achieve the same job in only 16 pins. The same applies to seven segment displays you are using.

You can easily find tons of examples online on multiplexing seven segment displays.

sonh:
hi all,

I forgot to mention that I am using dual 7-segment from Lite-On (part # LTD-4608JF). Thanks.

You also forgot to mention how you wired it up.

hi,

thanks for your reply and sorry for slow response. I wire as follow:

UNO pin # dual 7segment pin #
2 connect 330ohm 10 (a)
3 connect 330ohm 8 (b)
4 connect 330ohm 1 (c)
5 connect 330ohm 5 (d)
6 connect 330ohm 3 (e)
7 connect 330ohm 6 (f)
8 connect 330ohm 7 (g)
9 connect 330ohm 2 (dp)
10 digit 1
11 digit 2

note: I connect 330ohm from UNO pin to 7segment for all segments except digit 1 and digit 2.

and the code ?
it would help if you could also show the actual picture of how it all comes together, especially with the connection to ground.

in any case, you can only show one digit at a time.
see the previous post about multiplexing - this is a trick where you "take turns" turning on one digit, turning it off, and then turning the other one on, and repeating the cycle VERY FAST which tricks the human eye to thinking they're both on.

OK so you are multiplexing them.
However you can not source all the current for all the segments from just pin 10 ( or 11 ), that would add up to a total of 72mA way over the 40mA point where damage starts to occur.

You have a common anode display so you must supply digit 1 & 2 with a switched voltage.
You must wire up the two digits through a pnp transistor and drive the base of that through a resistor from your arduino pins.

Grumpy_Mike:
...
...
You have a common anode display so you must supply digit 1 & 2 with a switched voltage.
You must wire up the two digits through a pnp transistor and drive the base of that through a resistor from your arduino pins.

sounds quite advanced; if not to you, Mike !
i searched "switched voltage" and it gave pages re: voltage regulators - that's not what you mean, right ?
is it more along the lines of this ?

is it more along the lines of this ?

No.
That is an external current sink you need an external current source.

Something like this:-

7segment.gif

ohh, "yay for schematics" :smiley:
(one thousand valuable words !)

so the transistors are just being used to drive a current that is too big for the Arduino.

hi all,

thanks for all your valuable inputs. I'll do some homework based on your inputs.

thanks and cheer!!!