CS50 Python , Nutrition Facts Table
| Seven LED Display |
Exactly, what you see in the picture on top is a sample of a seven led display which uses a decimal number from 0-9 for as many digits as needed. Also, alpha characters (letters and symbols)can be used.
| Figure.1 |
Simply because it contains seven elements as shown in Figure.1. The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top, middle, and bottom. The optional decimal point (an "eighth segment", referred to as DP) is used for the display of non-integer numbers.
| Figure.2 |
As shown in Figure.2, this is how the numbers are shown. For example, "0" means all segments from A-G are led(shown), "1" means B and C are shown.
And below table shows us the plan of our code
| Seven Segments-LED display |
If you want to get a full idea about How Seven Segment LED Display works, you will find a slideshow in the end of the post.
We will code/draw each segment as "#". Note, the "horizontal segments" have ###, "vertical segments" have #. So, "0" will look like below:
###
# #
# #
# #
###
While "8" will show like this in the console:
###
# #
###
# #
###
Comments
Post a Comment
Your opinion matters, your voice makes us proud and happy. Your words are our motivation.