You're using 12 GPIO lines to drive four displays. Now look at using a shift register or BCD to 7-segment controller chip. You can easily drive 16, 7-segment displays on 8 gpio lines (four for data, four for select).

I Come from Germany and my English is bad... Sorry about that.
I try 5 days to run a 7 segment display like this example but it doesn't work. Cable 10 times checked segment for segment tested. Has anything changed python or so?

How do you have your display wired give us a Fritzing diagram and/or a photo of your wiring? Are you using a BCD to 7-seg decoder? Are you using a shift register? Or are you trying to multiplex the display directly from the GPIO pins?

First question is your 7 seg display common anode or common cathode? The OP doesn't tell us which model he's using. If it's the opposite we're going to have to turn all the logic upside down in his code.

It's not really working for me. I think I have the correct wiring I have 4 digits 7 segment: LTC-5623-HR and I have
File "time.py", line 62
if (int(time.ctime()[18:19])%2 == 0) and (digit == 1)
^
SyntaxError: invalid syntax

Next step is converting this in a generic "display_script.py" reading its data from an external source.
The fun part is the display cannot stop/starve (always dynamic).

I am thinking about using the global variable approach os.environ.["7SEGDISP"]="0123":

example:
script "calculate_primes.py" outputs the value in chunck to a system ENV variable "7SEGDISP" , and "display_script.py" loops and constantly update the display according to the ENV variable "7SEGDISP".

I want to avoid passing data via a file (SD card wear), and I know that one flaw in my idea is that both scripts needs to be started in the same terminal.

let me know if you believe there is a better way than what i am thinking about (Maybe a ramdisk file ?)

Ben

Autism/Asperger syndrome: what is your score on this quiz? http://www.raspberrypi.org/forums/viewtopic.php?f=62&t=70191

I'm new to Python and I was wanting to make a digital clock for my bedroom. I tore apart an old LED digital clock that didn't work right, scavenged the digit mask from the old display and build my own display using tiny red axial-leaded "SuperBright" LEDs.

I've got a couple of issues still outstanding with this approach, specifically the LEDs are *VERY" dim (I'll work on that, maybe using a higher voltage to the LEDs, switched by transistors. The second issue is that I would like the clock to be a 12-hour clock (AM/PM indicator is desirable, but not necessary).

My display has an incomplete first digit so it can only display a "1" or nothing for the first digit. It looks like the only way to accomplish this would be to use "time.strftime" instead of "time.ctime" because it has the option of %H for 24-hr hours or %I for 12-hr hours.

Does anyone have any suggestions on how to modify the code to display 12-hr time?

Thanx for sharing this!
I used it as a base in my project creating a display device that will show time, temperature and some other information on a 4-digit 7-segment display. The project is available here https://github.com/teddycool/ClockDisplay

What I don’t understand is this: if I need to display an “8.”, with your code I will power on 8 leds simultaneously for about 0.001s okay? But… every led consume about 13mA and 8*13 = 104. It doesn’t respect the 50mA total rule! Even for a very short perdiod, are you sure it doesn’t damage GPIO controller ?

What about limiting two or tree segments simultaneously for a very short time and then light another bunch of 3 leds but do not allow all leds if needed simultaneously? Wouldn’t be safer?

we have just recieved two of these https://www.aliexpress.com/item/4-Bits- ... 20e1e5d1a1 TM1637-for-Arduino-Raspberry-PI. We are looking for any help and advise with wiring and pinouts for use with our Pi-3's Also what would be the best code to use to allow us to use them as clocks??