Difference between revisions of "Component: LED Charlieplex (LEDs)"

From Flowcode Help
Jump to navigationJump to search
 
(11 intermediate revisions by the same user not shown)
Line 14: Line 14:
 
==LED Charlieplex component==
 
==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.
 
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: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_LED_charlieplex.fcfx FC_Comp_Source_LED_charlieplex.fcfx]
 +
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_LED_charlieplex.fcfx FC_Comp_Source_LED_charlieplex.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 28: Line 50:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 72: Line 110:
 
[[File:cp_4.jpg]]
 
[[File:cp_4.jpg]]
  
==Downloadable macro reference==
 
  
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
==Macro reference==
 +
 +
===AllOff===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AllOff'''
|-
 
| colspan="2" | Turn on the selected LED 
 
 
|-
 
|-
 +
| colspan="2" | Turns off all elements 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Index
 
|-
 
| colspan="2" | Index of the LED to turn on starting from 1. 
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 92: Line 136:
  
  
 +
===GetHandle===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 105: Line 150:
 
| colspan="2" |  
 
| colspan="2" |  
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===LEDOn===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AllOff'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn'''
 +
|-
 +
| colspan="2" | Turn on the selected LED 
 +
|-
 
|-
 
|-
| colspan="2" | Turns off all elements 
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 
|-
 
|-
 +
| colspan="2" | Index of the LED to turn on starting from 1. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  
Line 133: Line 182:
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Show
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
|-
 
| colspan="2" | 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. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Color
 
|-
 
| colspan="2" | Color of the labels text. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Scale
 
|-
 
| colspan="2" | Sets the basic size (text height) of the labels. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Follow Zoom
 
|-
 
| colspan="2" | Whether labels get bigger and smaller when the panel is zoomed in and out. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Position
 
|-
 
| colspan="2" | Set the position of the label relative to the component. 
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 
 
|-
 
|-
 
|-
 
|-
Line 187: Line 211:
 
| colspan="2" | Chip pin connection for charlieplexed signal 2 
 
| colspan="2" | Chip pin connection for charlieplexed signal 2 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 
|-
 
|-
 
|-
 
|-
Line 210: Line 234:
 
|-
 
|-
 
| colspan="2" | Height of the LED shape. 
 
| colspan="2" | Height of the LED shape. 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Reverse
 +
|-
 +
| colspan="2" | Reverse the direction of the LEDs. 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-12-icon.png]]
 +
| width="90%" | Type
 +
|-
 +
| colspan="2" | Type of shape 
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Colors
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Label
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Show
 +
|-
 +
| colspan="2" | 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. 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 +
| width="90%" | Color
 +
|-
 +
| colspan="2" | Color of the labels text. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| width="90%" | Depth
+
| width="90%" | Scale
 
|-
 
|-
| colspan="2" | Depth of the LED shape. 
+
| colspan="2" | Sets the basic size (text height) of the labels. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Reverse
+
| width="90%" | Follow Zoom
 
|-
 
|-
| colspan="2" | Reverse the direction of the LEDs. 
+
| colspan="2" | Whether labels get bigger and smaller when the panel is zoomed in and out. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Shape
+
| width="90%" | Position
 
|-
 
|-
| colspan="2" | Shape for the LED when no target is selected. 
+
| colspan="2" | Set the position of the label relative to the component. 
 
|}
 
|}

Latest revision as of 13:11, 7 February 2023

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.