Difference between revisions of "Component: LED Charlieplex (LEDs)"
Line 109: | Line 109: | ||
[[File:cp_4.jpg]] | [[File:cp_4.jpg]] | ||
+ | |||
+ | |||
Line 114: | Line 116: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===LEDOn=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 132: | Line 135: | ||
+ | ===GetHandle=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 150: | Line 154: | ||
+ | ===AllOff=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:51, 3 February 2023
Author | Matrix Ltd. |
Version | 1.5 |
Category | LEDs |
Contents
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.
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.
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.
Here is an example of a 4-pin setup.
Macro reference
LEDOn
![]() |
LEDOn |
Turn on the selected LED | |
![]() |
Index |
Index of the LED to turn on starting from 1. | |
![]() |
Return |
GetHandle
![]() |
GetHandle |
Retrieves the object handle of the indexed clone. Returns zero for out of range indexes. | |
![]() |
Index |
![]() |
Return |
AllOff
![]() |
AllOff |
Turns off all elements | |
![]() |
Return |