Difference between revisions of "Component: RGB LED LP5030 LP5036 (LEDs)"
From Flowcode Help
Jump to navigationJump to search(7 intermediate revisions by the same user not shown) | |||
Line 16: | Line 16: | ||
==Component Source Code== | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_LP5036_RGB_LED.fcfx FC_Comp_Source_LP5036_RGB_LED.fcfx] | ||
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_LP5036_RGB_LED.fcfx FC_Comp_Source_LP5036_RGB_LED.fcfx] | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_LP5036_RGB_LED.fcfx FC_Comp_Source_LP5036_RGB_LED.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 42: | Line 50: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 63: | Line 77: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Macro reference== | ||
+ | |||
+ | ===GetBrightness=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetBrightness''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Gets the brightness of a single LED. |
|- | |- | ||
|- | |- | ||
Line 150: | Line 103: | ||
| width="90%" | Address | | width="90%" | Address | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range: 0-11 |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | RGB |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Byte array containing at least 3 bytes to store Red, Green and Blue |
|- | |- | ||
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===GetDiscreteRGB=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDiscreteRGB''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Gets the RGB format colour of a single LED. |
|- | |- | ||
|- | |- | ||
Line 181: | Line 130: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | ColourIndex |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===GetRGB=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRGB''' |
|- | |- | ||
− | | colspan="2" | Gets the | + | | colspan="2" | Gets the RGB colour of a single LED. Array variables only. For individual variables, use GetDiscreteRGB |
|- | |- | ||
|- | |- | ||
Line 207: | Line 157: | ||
|- | |- | ||
| colspan="2" | Byte array containing at least 3 bytes to store Red, Green and Blue | | colspan="2" | Byte array containing at least 3 bytes to store Red, Green and Blue | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 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 231: | Line 163: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 244: | Line 177: | ||
− | + | ===ReadReg=== | |
− | |||
− | == | ||
− | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
− | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9- | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadReg''' |
|- | |- | ||
+ | | colspan="2" | Reads the data from one or more sequential registers | ||
|- | |- | ||
− | |||
− | |||
|- | |- | ||
− | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |
− | | width="10%" align="center" | [[File:Fc9- | + | | width="90%" | Address |
− | | width="90%" | | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" | Data |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | + | | width="90%" | Count | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | width="90%" | | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 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 345: | Line 206: | ||
+ | ===SetBrightness=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 368: | Line 230: | ||
+ | ===SetDiscreteRGB=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDiscreteRGB''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Allows the colour of a single LED to be specified in RGB format |
|- | |- | ||
|- | |- | ||
Line 379: | Line 242: | ||
| width="90%" | Address | | width="90%" | Address | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range: 0-11 |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Red |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Green |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Blue |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 424: | Line 264: | ||
+ | ===SetRGB=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 429: | Line 270: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRGB''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRGB''' | ||
|- | |- | ||
− | | colspan="2" | Allows the colour of a single LED to be specified in RGB. | + | | colspan="2" | Allows the colour of a single LED to be specified in RGB. Array variables only. For individual variables and literal values, use SetDiscreteRGB |
|- | |- | ||
|- | |- | ||
Line 447: | Line 288: | ||
+ | ===SetUnitAddress=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetUnitAddress''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Allows the component to taklk to more then one IC or broadcast to all connected ICs. |
|- | |- | ||
|- | |- | ||
Line 458: | Line 300: | ||
| width="90%" | Address | | width="90%" | Address | ||
|- | |- | ||
− | | colspan="2" | Range: 0- | + | | colspan="2" | Range: 0-3 = Individual / 4 = Broadcast |
|- | |- | ||
− | + | | 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- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===WriteReg=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteReg''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Writes data to one or more sequential registers |
|- | |- | ||
|- | |- | ||
Line 481: | Line 319: | ||
| width="90%" | Address | | width="90%" | Address | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90% | + | | width="90%" | Data |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | colspan="2" | |
− | |||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | Count | ||
|- | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| 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'' | ||
|} | |} | ||
− | |||
− | |||
Latest revision as of 10:26, 20 October 2023
Author | Matrix TSL |
Version | 1.0 |
Category | LEDs |
Contents
RGB LED LP5030 LP5036 component
An I2C Based RGB LED driver with 30 or 36 individual constant-current sinks. Used to drive 10 or 12 RGB LEDs with a wide range of applications.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_LP5036_RGB_LED.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_LP5036_RGB_LED.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
GetBrightness
![]() |
GetBrightness |
Gets the brightness of a single LED. | |
![]() |
Address |
Range: 0-11 | |
![]() |
RGB |
Byte array containing at least 3 bytes to store Red, Green and Blue | |
![]() |
Return |
GetDiscreteRGB
![]() |
GetDiscreteRGB |
Gets the RGB format colour of a single LED. | |
![]() |
Address |
Range: 0-11 | |
![]() |
ColourIndex |
![]() |
Return |
GetRGB
Initialise
![]() |
Initialise |
Starts up the I2C comms ready for communicating with the LP503x module. Must be called before any of the other component macros are called. | |
![]() |
Return |
ReadReg
![]() |
ReadReg |
Reads the data from one or more sequential registers | |
![]() |
Address |
![]() |
Data |
![]() |
Count |
![]() |
Return |
SetBrightness
SetDiscreteRGB
![]() |
SetDiscreteRGB |
Allows the colour of a single LED to be specified in RGB format | |
![]() |
Address |
Range: 0-11 | |
![]() |
Red |
![]() |
Green |
![]() |
Blue |
![]() |
Return |
SetRGB
SetUnitAddress
![]() |
SetUnitAddress |
Allows the component to taklk to more then one IC or broadcast to all connected ICs. | |
![]() |
Address |
Range: 0-3 = Individual / 4 = Broadcast | |
![]() |
Return |
WriteReg
![]() |
WriteReg |
Writes data to one or more sequential registers | |
![]() |
Address |
![]() |
Data |
![]() |
Count |
![]() |
Return |