Difference between revisions of "Component: 7Segment (Single) (Segment)"
(3 intermediate revisions by 2 users not shown) | |||
Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_LED_7Seg_Single_2dgi.fcfx FC_Comp_Source_LED_7Seg_Single_2dgi.fcfx] |
− | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_LED_7Seg_Single_2dgi.fcfx FC_Comp_Source_LED_7Seg_Single_2dgi.fcfx] |
==Detailed description== | ==Detailed description== | ||
Line 41: | Line 41: | ||
==Examples== | ==Examples== | ||
+ | ===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. | ||
+ | {{Fcfile|7Seg_Test.fcfx|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. | ||
+ | {{Fcfile|7Seg_Test2.fcfx|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. | ||
+ | {{Fcfile|7Seg_Test3.fcfx|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. | ||
− | + | {{Fcfile|7segCharDemo.fcfx|7Segment Character Demo}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 206: | Line 212: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | ||
− | | width="90%" | LED | + | | width="90%" | LED Colour |
|- | |- | ||
| colspan="2" | Color when an LED is turned on. When turned off, will use a much darker shade of the same hue. | | colspan="2" | Color when an LED is turned on. When turned off, will use a much darker shade of the same hue. | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | ||
− | | width="90%" | Bezel | + | | width="90%" | Bezel Colour |
|- | |- | ||
| colspan="2" | Color of the plastic package housing the LEDs | | colspan="2" | Color of the plastic package housing the LEDs | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | ||
− | | width="90%" | Label | + | | width="90%" | Label Colour |
|- | |- | ||
| colspan="2" | Color of the optional segment name labels. | | colspan="2" | Color of the optional segment name labels. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | ||
+ | | width="90%" | LED Auto Off Colour | ||
+ | |- | ||
+ | | colspan="2" | Color when an LED is turned on. When turned off, will use a much darker shade of the same hue. | ||
|} | |} |
Latest revision as of 11:57, 3 November 2023
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 Source Code
Please click here to download the component source project: FC_Comp_Source_LED_7Seg_Single_2dgi.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_LED_7Seg_Single_2dgi.fcfx
Detailed description
No detailed description exists yet for this component
Examples
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.
Macro reference
ClearDigit
ShowDigit
ShowSegments
![]() |
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 |