In this example we'll show the current time of our raspberry pi system on the 4 segment LED display. Please note,
you'll need to configure the right timezone through the "sudo raspi-config" settings else the time you'll see might be
different from the actual time zone you are at right now.
Let's walk through our code and try to understand it: we'll show the hours on the first two columns of the segment
LED and the minutes on the second two columns.
We first start a while loop (forever) we get the current time from the time library then we go for each digit (we got
total of 4 digits) and loop through total of 7 numbers. And then we output HIGH for the right number that is
currently on the clock (based on the current time) and LOW for the time that is wrong (not the current time)
Compile the script by going into the samples directory and running: python3 4digit_segment.py
Application effect
Running the program will show us the current time on the segment clock.
LESSON 10: HEART-SHAPED DISPLAY
43 of 114
Need help?
Do you have a question about the Raspberry Pi & Arduino Starter Kit and is the answer not in the manual?