Component: LED Charlieplex (LEDs)

From Flowcode Help
Jump to navigationJump to search
Author Matrix Ltd.
Version 1.5
Category LEDs


LED Charlieplex component

Create an evenly spaced array of LED indicators using a reduced amount of I/O pins. Only one LED can be switched on at once, high speed multiplexing allows multiple LEDs to appear to be lit at once. Each will be connected in line with the standard charlieplex scheme. 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_charlieplex.fcfx

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

Detailed description

No detailed description exists yet for this component

Examples

The Charlieplex scheme simply places two LEDs between each combination of two microcontroller control pins. One LED in forward bias the the other LED in reverse bias.


With two control pins you can control up to two LEDs or a single bicolour LED.

With three control pins you can control up to six LEDs or up to three bicolour LEDs.

With four control pins you can control up to twelve LEDs or up to six bicolour LEDs.


If all the LEDs you want to drive have the same characteristics then you can wire up like this to use the same current limiting resistors to drive multiple LEDs.

Cp 3.jpg


If the LEDs you want to drive have different characteristics then you can wire up like this to use different current limiting resistors for each individual LED.

Charlie Individual.png


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


Here is an example of a 4-pin setup.


Cp 4.jpg






Macro reference

AllOff

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


GetHandle

Fc9-comp-macro.png GetHandle
Retrieves the object handle of the indexed clone. Returns zero for out of range indexes. 
Fc9-u8-icon.png - BYTE Index
 
Fc9-h32-icon.png - HANDLE 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 starting from 1. 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Pin Count
The number of pins to dedicate to the charlieplexed output. 
Fc9-type-21-icon.png LED Count
The maximum number of LEDs that can be individually addressed based on the number of pins available. 
Fc9-type-5-icon.png Pin 0
Chip pin connection for charlieplexed signal 0 
Fc9-type-5-icon.png Pin 1
Chip pin connection for charlieplexed signal 1 
Fc9-type-5-icon.png Pin 2
Chip pin connection for charlieplexed signal 2 
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png Alignment
Which 3D axis to align the copies along. 
Fc9-type-15-icon.png 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. 
Fc9-type-15-icon.png Width
Width of the LED shape. 
Fc9-type-15-icon.png Height
Height of the LED shape. 
Fc9-type-7-icon.png Reverse
Reverse the direction of the LEDs. 
Fc9-type-12-icon.png Type
Type of shape 
Fc9-conn-icon.png Colors
Fc9-conn-icon.png Label
Fc9-type-16-icon.png 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. 
Fc9-type-1-icon.png Color
Color of the labels text. 
Fc9-type-15-icon.png Scale
Sets the basic size (text height) of the labels. 
Fc9-type-7-icon.png Follow Zoom
Whether labels get bigger and smaller when the panel is zoomed in and out. 
Fc9-type-16-icon.png Position
Set the position of the label relative to the component.