Jump to content

Component: LED (EB004) (E-blocks 1): Difference between revisions

From Flowcode Help
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{| style="width:50%"
 
{| width="50%"
|-
|-
| width="20%" style="color: gray;" | Author
| width="20%" style="color:gray;" | Author
| Matrix TSL
| Matrix TSL
|-
|-
| width="20%" style="color: gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.1 (Release)
| 1.1
|-
|-
| width="20%" style="color: gray;" | Category
| width="20%" style="color:gray;" | Category
| E-blocks 1
| E-blocks 1
|}
|}




 
==LED  component==
==[[File:Component Icon 82c2f7d0_c6ed_4c6e_8ab8_7958b490dc99.png|Image]] LED  (EB004) component==
An LED matrix made up of standard PCB mount 5mm LEDs.
An LED matrix made up of standard PCB mount 5mm LEDs.


==Examples==
==Component Source Code==


Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_LED_Array_EB004.fcfx FC_Comp_Source_LED_Array_EB004.fcfx]


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_LED_Array_EB004.fcfx FC_Comp_Source_LED_Array_EB004.fcfx]


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


[[File:LED_Active.jpg]]




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.


[https://www.digikey.co.uk/en/resources/conversion-calculators/conversion-calculator-led-series-resistor  LED Resistor Calculator Tool]


==Downloadable macro reference==
''No detailed description exists yet for this component''


===<span style="font-weight: normal;"><u><tt>BarGraph</tt></u></span>===
==Examples==
Turns on the first N elements of the array - for generating bar graph metes etc.


'''Parameters'''


:[[Variable Types|BYTE]] ''Length''
::How many items to light up.




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>LEDOn</tt></u></span>===
Turn on the selected LED.


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::Index of the LED to turn on.




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>AllOn</tt></u></span>===
Turns on all elements


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


:''This macro has no parameters''
[[File:LED_Active.jpg]]




'''Return value'''
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.


:''This call does not return a value''


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.


===<span style="font-weight: normal;"><u><tt>LEDOff</tt></u></span>===
Turn off the selected led.


'''Parameters'''
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.


:[[Variable Types|BYTE]] ''Index''
::Index of the LED to turn on.


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


'''Return value'''
[https://www.digikey.co.uk/en/resources/conversion-calculators/conversion-calculator-led-series-resistor  LED Resistor Calculator Tool]


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>PointGraph</tt></u></span>===
Turns on the Indexed LED and turns all others off.


Does nothing if the index is out of range.


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::The LED to show.




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>WriteValue</tt></u></span>===
==Macro reference==
Write a number which is presented on the LEDs in binary.


'''Parameters'''
===AllOff===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''AllOff'''
|-
| colspan="2" | Turns off all elements&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


:[[Variable Types|BYTE]] ''Value''
::Provide a value to be written to the LEDs in binary


===AllOn===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''AllOn'''
|-
| colspan="2" | Turns on all elements&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


'''Return value'''


:''This call does not return a value''
===BarGraph===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''BarGraph'''
|-
| colspan="2" | Turns on the first N elements of the array - for generating bar graph metes etc.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Length
|-
| colspan="2" | How many items to light up.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




===<span style="font-weight: normal;"><u><tt>AllOff</tt></u></span>===
===LEDOff===
Turns off all elements
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''LEDOff'''
|-
| colspan="2" | Turn off the selected led.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Index of the LED to turn on.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


'''Parameters'''


:''This macro has no parameters''
===LEDOn===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''LEDOn'''
|-
| colspan="2" | Turn on the selected LED.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Index of the LED to turn on.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




'''Return value'''
===PointGraph===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| 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.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | The LED to show.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


:''This call does not return a value''


 
===WriteValue===
 
{| class="mtx-class-macrotable wikitable"
==Simulation macro reference==
|-
 
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
''This component does not contain any simulation macros''
| width="90%" class="mtx-class-macrohead" | '''WriteValue'''
|-
| colspan="2" | Write a number which is presented on the LEDs in binary.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
|-
| colspan="2" | Provide a value to be written to the LEDs in binary&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




==Property reference==
==Property reference==
<span style="font-weight: normal;"><u>Output Mode</u></span>


This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''port''.
{| class="mtx-class-macrotable wikitable"
 
|-
Choose a single port for all LEDs, or to allocate them to arbitrary pins.
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
 
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
<span style="font-weight: normal;"><u>Port</u></span>
|-
 
|-
This property is of type ''Digital port byte'' and can be referenced with the variable name ''PortByte''.
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
 
| width="90%" class="mtx-class-propfolder" | Connections
''<span style="color:red;">No additional information</span>''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Output Mode
|-
| colspan="2" | Choose a single port for all LEDs, or to allocate them to arbitrary pins.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-19-icon.png]]
| width="90%" | Port
|-
| colspan="2" | &nbsp;
|}

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 1.1
Category E-blocks 1


LED component

An LED matrix made up of standard PCB mount 5mm LEDs.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

LEDs can be wired either active high or active low. The LED components should each 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


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
Connections
Output Mode
Choose a single port for all LEDs, or to allocate them to arbitrary pins. 
Port