7 Segment display project
7 Segment display project
The 7 Segment display I am using started life in an electronic project some years ago. The 7 segment display was unsoldered and removed from the original PCB for re-use. The device in this case is Common Anode so have to bear that in mind when writing the code.
To wire this project I used a small breadboard. I used 100 ohm resistors on the segment inputs. The 7 segment display I used is a KYX-5462BS , be aware there are many similar devices with different common anode or common cathode layouts.
To create the code I used python. There are many similar projects available with code.
If you have a chance visit the links below to get ideas how this works.
https://peppe8o.com/how-to-control-a-4-digit-7-segment-display-from-raspberry-pi-with-python/
https://www.noumansaleem.com/avr/2018/08/11/seven-segment-display-raspberry-pi-python.html
https://gist.github.com/lurch/c6965457172a1b89a8bc
As my code is very similar to what you find in the above sites, I will let you experiment and create your own. Don't forget to place a delay for the display to make it less flickery.
One thing I learnt from this project is to use the system call (time.strftime("%H.%M")) which returns the hours and minutes without having to strip them out of the time string Mon 10 May 10:34:56 BST 2021
https://docs.python.org/3/library/datetime.html?highlight=strftime