agrumiro
Posts: 4
Joined: Sun Jan 10, 2016 8:14 pm

Use 4 digits 7 segments display

Sun Jan 10, 2016 8:25 pm

Hi,
I want to use my display 4 digits with 7 segments (hs420561k-32) in W10 IoTCore on Raspberry PI 2 B+.

I've followed below tutorial
https://www.hackster.io/leonardomachado ... -21-0e0ce3

Wire
SegA = pin 25,
SegB = pin 21,
SegC = pin 13,
SegD = pin 5,
SegE = pin 22,
SegF = pin 12,
SegG = pin 19,
dot = 6,
D1 = pin 24,
D2 = pin 16,
D3 = pin 20,
D4 = pin 26

But it doesn't works as expected, please look at
https://drive.google.com/open?id=0B4d4K ... 3hBMlVpUlk

The display blink so not all digits are visible at same time.

Can you help me please? Do you know someone that has used 4 digits display with IoTCore?

Thank you

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Use 4 digits 7 segments display

Sun Jan 10, 2016 9:11 pm

There are many examples of using GPIO pins to drive groups of signals. Try Hackster.io, the MS development site or Github
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

agrumiro
Posts: 4
Joined: Sun Jan 10, 2016 8:14 pm

Re: Use 4 digits 7 segments display

Sun Jan 10, 2016 9:15 pm

Can you give me samples on how to use 4 digits display, please?
I've followed tutorial on hackster.io, same wired, same components, same code but result is wrong, display blink.

Let me know, please.

Thank you

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Use 4 digits 7 segments display

Sun Jan 10, 2016 9:40 pm

Probably your bet bet is to talk to the developer on the Hakster.io project then. They know their code and its limitations best of all.
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

User avatar
DougieLawson
Posts: 38456
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Use 4 digits 7 segments display

Sun Jan 10, 2016 9:49 pm

Your hardware driver and the software you've written is common cathode, your display is common anode (or vice versa).

You may need to invert the signals with a set of transistors (or an inverter chip), turn the display upside down (connect the pins the other way) and/or change software (or all three).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

agrumiro
Posts: 4
Joined: Sun Jan 10, 2016 8:14 pm

Re: Use 4 digits 7 segments display

Sun Jan 10, 2016 10:00 pm

DougieLawson wrote:Your hardware driver and the software you've written is common cathode, your display is common anode (or vice versa).

You may need to invert the signals with a set of transistor, turn the display upside down (connect the pins the other way) or change software (or all three).
Yes, my display is Common Cathode, so i'm using software as specified in Common Cathode

Code: Select all

lm7Seg = new LM7SegDirect(25, 21, 13, 5, 22, 12, 19, 6, false);
lm7Seg.defineDigits(4, 24, 16, 20, 26);
Problem was refresh time, maybe.

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Use 4 digits 7 segments display

Sun Jan 10, 2016 10:09 pm

Or maybe check the wiring and wiring logic
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

User avatar
DougieLawson
Posts: 38456
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Use 4 digits 7 segments display

Sun Jan 10, 2016 10:16 pm

The article you linked to explicitly states common anode, so start setting everything that's logic 0 to logic 1 and check your wiring.

A segment/DP lights when you've got HIGH (1) on the ANODE and LOW (0) on the CATHODE.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

agrumiro
Posts: 4
Joined: Sun Jan 10, 2016 8:14 pm

Re: Use 4 digits 7 segments display

Sun Jan 10, 2016 10:22 pm

DougieLawson wrote:The article you linked to explicitly states common anode, so start setting everything that's logic 0 to logic 1 and check your wiring.

A segment/DP lights when you've got HIGH (1) on the ANODE and LOW (0) on the CATHODE.
Hi,
if you look at code shared in linked article, you would see last param of LM7SegDirect constructor is used to set "Common anode" or "Common cathode". So if you set it to false you stay using "Common cathode", right?
If i use just 1 digit, code works very well, problem is present when you use more digits.

Return to “Windows 10 for IoT”