Difference between revisions of "Component: Simulation 7 Seg (Misc)"
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_temp/LED_7Seg_Single_Sim_2dgi.fcfx FC_Comp_Source_temp/LED_7Seg_Single_Sim_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_temp/LED_7Seg_Single_Sim_2dgi.fcfx FC_Comp_Source_temp/LED_7Seg_Single_Sim_2dgi.fcfx] |
==Detailed description== | ==Detailed description== | ||
Line 119: | Line 119: | ||
Switches connected to Port D allow for the timer to be started, stopped and reset. | Switches connected to Port D allow for the timer to be started, stopped and reset. | ||
{{Fcfile|7Seg_Test3.fcfx|7Segment Timer}} | {{Fcfile|7Seg_Test3.fcfx|7Segment Timer}} | ||
+ | |||
+ | |||
Line 144: | Line 146: | ||
− | === | + | ===SegControl=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SegControl''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Direct control over the display segments |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | data |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 168: | Line 165: | ||
− | === | + | ===ShowDigit=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ShowDigit''' |
+ | |- | ||
+ | | colspan="2" | Creates the supplied digit on the 7 segment display. Macro takes the digit to display and a boolean representing whether to display the decimal point segment or not. | ||
+ | |- | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | Digit | ||
|- | |- | ||
+ | | colspan="2" | Sets the 7seg display with the appropriate digit supplied | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | DecimalPoint |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Determines whether decimal point LED is active (True/False) |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
Revision as of 12:01, 3 February 2023
Author | Matrix Ltd |
Version | 1.0 |
Category | Misc |
Contents
Simulation 7 Seg component
Simulated single digit seven segment display. LED colour can be changed in properties.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_temp/LED_7Seg_Single_Sim_2dgi.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_temp/LED_7Seg_Single_Sim_2dgi.fcfx
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.
Basic Multiplexing
Only one of the four 7-segment LEDs can be enabled at a time so we need a way of multiplexing the output so that we can display a number on all four LEDs. To do this we switch between LED outputs at fairly high speed and persistence of vision allows the display to appear fixed and constant.
This example demonstrates a very basic loop to display a four digit number multiplexed across four 7segment displays.
Quad 7Segment Display Example
Timer Based Multiplexing
This example demonstrates a timer interrupt to display a four digit number multiplexed across four 7segment displays. The timer interrupt takes care of updating the display leaving our program free to count up in 100ms increments.
Quad 7Segment Display Example 2
The panel should show the simulation run time down to the current tenth of a second.
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
Macro reference
ClearDigit
SegControl
![]() |
SegControl |
Direct control over the display segments | |
![]() |
data |
![]() |
Return |
ShowDigit
Property reference
![]() |
Properties |
![]() |
Colors |
![]() |
LED On Color |
Color when an LED is turned on. | |
![]() |
LED Off Color |
Color when an LED is turned off. | |
![]() |
Bezel Color |
Color of the plastic package housing the LEDs |