Component: LED Template (Outputs: LEDs)

From Flowcode Help
Jump to: navigation, search


Author Matrix Ltd
Version 1.3 (Development)
Category Outputs: LEDs


Contents

Image LED Template component

Base for creating LEDs and other on/off visual indicators. Choose a 'Target Object' that will change colour when the pin changes; if multiple objects must change color, group them, and target the group. When 'Auto off color" is selected, changing the 'on color' will automatically choose an off color by reducing the on-color intensity.

This component can be used as a base to create child components

The following components all inherit the traits of LED Template:

-
Image Dashboard lamp Indicator with bezel and label, particularly suitable for viewing on the dashboard.

Indicator on/off colors, bezel color and label all editable via properties.

Image LED (LES, Panel) Panel lamp for a LES bulb.

Colour can be changed in component properties.

Image LED (5mm, PCB) An industry standard 5mm diameter LED.

Any color may be chosen, and the leads trimmed to length.

Image LED (5mm, Panel) Standard 5mm LED mounted in a panel clip. Colour can be changed in component properties.
Image LED (SMD, PCB) Surface mount LED in standard PLCC2 package.

Colour can be set friom component properties.

Image LED (Generic) Basic LED component using simple geometric shapes.

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.

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

Downloadable macro reference

TurnOn

Turn the LED off.

Parameters

This macro has no parameters


Return value

This call does not return a value


TurnOff

Turn the LED on.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Pin

This property is of type Single digital pin and can be referenced with the variable name pin.

Chip pin to connect the LED to.

Polarity

This property is of type Fixed list of ints and can be referenced with the variable name polarity.

Active High: Pin true -> On color, Pin false -> Off color

Active Low: Pin true -> Off color, Pin false -> On color

Target Object

This property is of type Panel object and can be referenced with the variable name target_object.

Set a target object to be the illuminating part of the LED.

To change the colour of multiple objects, group them first, then target the group.

On Color

This property is of type Color picker and can be referenced with the variable name on_color.

The color of the LED when it is turned on.

Off Color

This property is of type Color picker and can be referenced with the variable name off_color.

The color of the LED when it is turned off.

Auto Off Color

This property is of type True or false and can be referenced with the variable name auto_off.

When this is selected, the off color is automatically set to a darker version of the on color.

Personal tools