Component: LED Array (LEDs)

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category LEDs


LED Array component

An array of LED indicators equally spaced and complete with labels to indicate their meaning. Embedded can be used to control an 8-bit port or up to 8 individual pins.

Component Source Code

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

Please click here to view the component source code (Beta): FC_Comp_Source_LED_Array_2dgi.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.

FC6 Icon.png LED KnightRider


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

FC6 Icon.png 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.

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.

LED Resistor Calculator Tool

Macro reference

AllOff

Fc9-comp-macro.png AllOff
Turns off all elements 
Fc9-void-icon.png - VOID Return


AllOn

Fc9-comp-macro.png AllOn
Turns on all elements 
Fc9-void-icon.png - VOID Return


BarGraph

Fc9-comp-macro.png BarGraph
Turns on the first N elements of the array - for generating bar graph metes etc. 
Fc9-u8-icon.png - BYTE Length
How many items to light up. 
Fc9-void-icon.png - VOID Return


LEDOff

Fc9-comp-macro.png LEDOff
Turn off the selected led. 
Fc9-u8-icon.png - BYTE Index
Index of the LED to turn on. 
Fc9-void-icon.png - VOID Return


LEDOn

Fc9-comp-macro.png LEDOn
Turn on the selected LED. 
Fc9-u8-icon.png - BYTE Index
Index of the LED to turn on. 
Fc9-void-icon.png - VOID Return


PointGraph

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


WriteValue

Fc9-comp-macro.png WriteValue
Write a number which is presented on the LEDs in binary. 
Fc9-u8-icon.png - BYTE Value
Provide a value to be written to the LEDs in binary 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Count
The number of LEDs in the array from 1 to 8. 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Output Mode
 
Fc9-type-19-icon.png Port
 
Fc9-type-16-icon.png Polarity
 
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png Switch layout
 
Fc9-type-21-icon.png Distance between LEDs
 
Fc9-type-2-icon.png Label colour
 
Fc9-type-16-icon.png Component Label
 
Fc9-type-7-icon.png Show Connection Label
If enabled, the pin designation will be shown, e.g. B0. 
Fc9-type-7-icon.png Show Pin Value
Pin status of VCC or GND will be shown when enabled and simualtion is running. 
Fc9-conn-icon.png Appearance
Fc9-type-16-icon.png Shape
 
Fc9-type-16-icon.png Colour
 
Fc9-type-16-icon.png Style