Jump to content

Component: LED Array Template (LEDs): Difference between revisions

From Flowcode Help
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead""
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(3 intermediate revisions by the same user not shown)
Line 100: Line 100:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AllOff'''
| width="90%" class="mtx-class-macrohead" | '''AllOff'''
|-
|-
| colspan="2" | Turns off all elements 
| colspan="2" | Turns off all elements 
Line 114: Line 114:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AllOn'''
| width="90%" class="mtx-class-macrohead" | '''AllOn'''
|-
|-
| colspan="2" | Turns on all elements 
| colspan="2" | Turns on all elements 
Line 128: Line 128:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BarGraph'''
| width="90%" class="mtx-class-macrohead" | '''BarGraph'''
|-
|-
| colspan="2" | Turns on the first N elements of the array - for generating bar graph metes etc. 
| colspan="2" | Turns on the first N elements of the array - for generating bar graph metes etc. 
Line 147: Line 147:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHandle'''
| width="90%" class="mtx-class-macrohead" | '''GetHandle'''
|-
|-
| colspan="2" | Retrieves the object handle of the indexed clone. Returns zero for out of range indexes. 
| colspan="2" | Retrieves the object handle of the indexed clone. Returns zero for out of range indexes. 
Line 166: Line 166:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOff'''
| width="90%" class="mtx-class-macrohead" | '''LEDOff'''
|-
|-
| colspan="2" | Turn off the selected led. 
| colspan="2" | Turn off the selected led. 
Line 185: Line 185:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn'''
| width="90%" class="mtx-class-macrohead" | '''LEDOn'''
|-
|-
| colspan="2" | Turn on the selected LED. 
| colspan="2" | Turn on the selected LED. 
Line 204: Line 204:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PointGraph'''
| width="90%" class="mtx-class-macrohead" | '''PointGraph'''
|-
|-
| colspan="2" | Turns on the Indexed LED and turns all others off. Does nothing if the index is out of range. 
| colspan="2" | Turns on the Indexed LED and turns all others off. Does nothing if the index is out of range. 
Line 223: Line 223:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteValue'''
| width="90%" class="mtx-class-macrohead" | '''WriteValue'''
|-
|-
| colspan="2" | Write a number which is presented on the LEDs in binary. 
| colspan="2" | Write a number which is presented on the LEDs in binary. 
Line 242: Line 242:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 251: Line 251:
| colspan="2" | The number of LEDs in the array from 1 to 8. 
| colspan="2" | The number of LEDs in the array from 1 to 8. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
|-
|-
Line 270: Line 270:
| colspan="2" | Active High = LEDs light when the chosen chip pin is ON Active Low = LEDs light when the chosen chip pin is OFF 
| colspan="2" | Active High = LEDs light when the chosen chip pin is ON Active Low = LEDs light when the chosen chip pin is OFF 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-
Line 289: Line 289:
| colspan="2" | Reverse the direction of the LEDs. 
| colspan="2" | Reverse the direction of the LEDs. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Shape
| width="90%" class="mtx-class-propfolder" | Shape
|-
|-
|-
|-
Line 318: Line 318:
| colspan="2" | Depth of the LED shape. 
| colspan="2" | Depth of the LED shape. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Colors
| width="90%" class="mtx-class-propfolder" | Colors
|-
|-
|-
|-
Line 332: Line 332:
| colspan="2" | The colour for LED 0 - or for all LEDs if that option is set. 
| colspan="2" | The colour for LED 0 - or for all LEDs if that option is set. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Label
| width="90%" class="mtx-class-propfolder" | Label
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 2.0
Category LEDs


LED Array Template component

Create an evenly spaced array of LED indicators. Each will be connected to sequential pins of a given I/O port. Set target object to point at any standard LED component to change the style.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_LED_Array.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_LED_Array.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Example program which uses the point graph macro and loops to create a knight rider effect using the LED array.

LED KnightRider


Example program which reads an analogue value from an analogue input voltage and displays the reading in Binary on the LED array.

LED Count


LEDs can be wired either active high or active low. The LED Array components have a property allowing you to configure which LED type your using.


An active high LED will light when the microcontroller pin is outputting a logic 1 and be off when the microcontroller pin is outputting a logic 0 or in input mode.


An active low LED will light when the microcontroller pin is outputting a logic 0 and be off when the microcontroller pin is outputting a logic 1 or in input mode.


The series resistor can be on either side of the LED and acts to protect the LED from damage due to excess current. The value of resistor used can be changed based on the brightness of the LED and power consumption.


This LED Calculator tool is a good resource for calculating the correct LED series protection resistor.

LED Resistor Calculator Tool






Macro reference

AllOff

AllOff
Turns off all elements 
- VOID Return


AllOn

AllOn
Turns on all elements 
- VOID Return


BarGraph

BarGraph
Turns on the first N elements of the array - for generating bar graph metes etc. 
- BYTE Length
How many items to light up. 
- VOID Return


GetHandle

GetHandle
Retrieves the object handle of the indexed clone. Returns zero for out of range indexes. 
- BYTE Index
 
- HANDLE Return


LEDOff

LEDOff
Turn off the selected led. 
- BYTE Index
Index of the LED to turn on. 
- VOID Return


LEDOn

LEDOn
Turn on the selected LED. 
- BYTE Index
Index of the LED to turn on. 
- VOID Return


PointGraph

PointGraph
Turns on the Indexed LED and turns all others off. Does nothing if the index is out of range. 
- BYTE Index
The LED to show. 
- VOID Return


WriteValue

WriteValue
Write a number which is presented on the LEDs in binary. 
- BYTE Value
Provide a value to be written to the LEDs in binary 
- VOID Return


Property reference

Properties
Count
The number of LEDs in the array from 1 to 8. 
Connections
Output Mode
Choose a single port for all LEDs, or to allocate them to arbitrary pins. 
Port
 
Polarity
Active High = LEDs light when the chosen chip pin is ON Active Low = LEDs light when the chosen chip pin is OFF 
Simulation
Alignment
Which 3D axis to align the copies along. 
Spacing
The distance between LEDs in the array. LEDs will be spaced symmetrically around the component centre. Use a negative value to reverse the order of the LEDs. 
Reverse
Reverse the direction of the LEDs. 
Shape
Target LED
Drag any LED component based on the 'LED base' onto the panel and select it here to use a custom LED design. When unconnected, you can choose a default geometric form instead.  
Shape
Shape for the LED when no target is selected. 
Width
Width of the LED shape. 
Height
Height of the LED shape. 
Depth
Depth of the LED shape. 
Colors
Same Color
Choose whether all LEDs should be the same color, or to set them individually. 
LED 0
The colour for LED 0 - or for all LEDs if that option is set. 
Label
Show
Decide what labels to show... None - no labels are displayed Name - shows each component's name Property - shows a particular property of each component (see 'property' below. 
Property
Show a particular property of each object. If a port or pin property is chosen, the label can be abbreviated to remove the '$PORT' text. 
Color
Color of the labels text. 
Scale
Sets the basic size (text height) of the labels. 
Follow Zoom
Whether labels get bigger and smaller when the panel is zoomed in and out. 
Position
Set the position of the label relative to the component.