Component: 7Segment (Single) (Segment)
Author | Matrix Ltd |
Version | 1.4 |
Category | Segment |
Contents
7Segment (Single) component
Seven segment display modelled after a standard 14mm high unit. LED colour can be changed in properties.
Component Pack
DISPLAYS
Detailed description
No detailed description exists yet for this component
Examples
Each segment will require a current limiting resistor.
This LED Calculator tool is a good resource for calculating the correct LED series protection resistor.
Simple Counter
This example counts up from 0 to 9 on the 7-segment display before wrapping back to 0 and starting again. When displaying odd numbers we light the decimal point segment.
7Segment Display Example
Multiplexed Counter
This next example counts up from 0 to 99 on two 7-segment displays before wrapping back to 0 and starting again. The two displays are driven using a technique called multiplexing. A timer interrupt is used to perform the multiplexing leaving our program free to perform other tasks. Each 7-segment display shares the same segment pin connections but has a unique common pin connection to allow each individual 7-segment display to display a unique value.
7Segment Multiplex
Stop Watch
This next example uses a timer interrupt to multiplex between the displays and a second timer interrupt to count the passing of time allowing for accurate timings. Using four single 7-seg components we create a timer capable of monitoring time from 0.0 to 999.9 seconds in multiples of 100ms. The second timer interrupt flags to the main when the count value has changed allowing the heavier calculations to extract the digits from the counter to be done outside of the high speed interrupt routine and therefore maintain accurate timing.
Switches connected to Port D allow for the timer to be started, stopped and reset.
7Segment Timer
Segment Control
This example shows a method to display custom characters on 7-segment displays and also allows for numeric values to be displayed.
Downloadable macro reference
![]() |
ShowSegments |
Allows the individual segments of the display to be controlled. | |
![]() |
Segments |
8-bit Binary value to set the segments, bit0 = segA, bit1 = segB... | |
![]() |
Return |