7 Segment Display
The 7-Segment display combines 7 LEDs and a common which that all segments share. The common may be either common anode or common cathode, depending on the selected type. The selection would determine whether the common was connected to the ground or -ve supply.
7-Segment displays take on more usefulness when multiple digits are grouped together, 2 or more enable data of more intuitive value to be displayed.
To drive or make a 7 Segment light up, the individual segments would be illuminated. The specific sequence of segments would, when combined, produce numerical digits that can be used to display decimal values.
๏ปฟ
When developing systems, there is a need to optimize the IO. To make the most of what is available, the 7 Segment Displays are multiplexed, or enabled by means of transistors.
- When for example the first digit has its value written, that value is loaded onto the port connected to displays, with the corresponding display being enabled.
- When for example the second digit has its value written, that value is loaded onto the port connected to displays, with the corresponding display being enabled, but the previous display being disabled.
- This sequence is repeated, many times a second providing the illusion that the displays are on all at the same time.
To produce this effect, you would need code that can 1) Perform the function of generating the data to be displayed and 2) display the data at the required refresh rate on the 7 Segment displays.
As your skills develop, systems like this will become more easy to develop. However, for today's usage, 7 Segment displays are more of a training or coding exercise. LCD or TFT displays are now relatively inexpensive and more desirable as they reduce the amount of shared time needed to perform functions by the MCU.
While the 7 Segment option would require the MCU to maintain the display actively, an LCD fro example is write and forget, and the display will be active until it is either cleared or new data is written.