Difference between revisions of "Component: RGB LED LP5030 LP5036 (LEDs)"

From Flowcode Help
Jump to navigationJump to search
Line 17: Line 17:
 
==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 download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/LP5036_RGB_LED.fcfx FC_Comp_Source_temp/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_temp/LP5036_RGB_LED.fcfx FC_Comp_Source_temp/LP5036_RGB_LED.fcfx]
  
 
==Detailed description==
 
==Detailed description==
Line 76: Line 76:
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
 +
 +
  
  
Line 82: Line 84:
  
 
==Macro reference==
 
==Macro reference==
 +
 +
===GetBrightness===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetBrightness'''
 +
|-
 +
| colspan="2" | Gets the brightness of a single LED.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | Range: 0-11&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | RGB
 +
|-
 +
| colspan="2" | Byte array containing at least 3 bytes to store Red, Green and Blue&nbsp;
 +
|-
 +
| 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''
 +
|}
 +
  
 
===GetDiscreteRGB===
 
===GetDiscreteRGB===
Line 131: Line 157:
  
  
===SetBrightness===
+
===Initialise===
 
{| 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;" | '''SetBrightness'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Allows the brightness of a single LED to be specified as a byte from 0 to 255. Default on reset is 255.&nbsp;
+
| colspan="2" | Starts up the I2C comms ready for communicating with the LP503x module. Must be called before any of the other component macros are called.&nbsp;
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
 
|-
 
|-
| colspan="2" | Range: 0-11&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Brightness
 
|-
 
| colspan="2" | Brightness value: Range 0-255&nbsp;
 
 
|-
 
|-
 
| 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 184: Line 200:
  
  
===SetDiscreteRGB===
+
===SetBrightness===
 
{| 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;" | '''SetDiscreteRGB'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetBrightness'''
 
|-
 
|-
| colspan="2" | Allows the colour of a single LED to be specified in RGB format&nbsp;
+
| colspan="2" | Allows the brightness of a single LED to be specified as a byte from 0 to 255. Default on reset is 255.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 199: Line 215:
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Red
+
| width="90%" | Brightness
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | Brightness value: Range 0-255&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Green
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Blue
 
|-
 
| colspan="2" | &nbsp;
 
 
|-
 
|-
 
| 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 218: Line 224:
  
  
===WriteReg===
+
===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;" | '''WriteReg'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDiscreteRGB'''
 
|-
 
|-
| colspan="2" | Writes data to one or more sequential registers&nbsp;
+
| colspan="2" | Allows the colour of a single LED to be specified in RGB format&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
| width="90%" | Address
 +
|-
 +
| colspan="2" | Range: 0-11&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Red
 
|-
 
|-
 
| colspan="2" | &nbsp;
 
| colspan="2" | &nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
+
| width="90%" | Green
 
|-
 
|-
 
| colspan="2" | &nbsp;
 
| colspan="2" | &nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Count
+
| width="90%" | Blue
 
|-
 
|-
 
| colspan="2" | &nbsp;
 
| colspan="2" | &nbsp;
Line 271: Line 282:
  
  
===GetBrightness===
+
===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;" | '''GetBrightness'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetUnitAddress'''
 
|-
 
|-
| colspan="2" | Gets the brightness of a single LED.&nbsp;
+
| colspan="2" | Allows the component to taklk to more then one IC or broadcast to all connected ICs.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 283: Line 294:
 
| width="90%" | Address
 
| width="90%" | Address
 
|-
 
|-
| colspan="2" | Range: 0-11&nbsp;
+
| colspan="2" | Range: 0-3 = Individual / 4 = Broadcast&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" | RGB
 
|-
 
| colspan="2" | Byte array containing at least 3 bytes to store Red, Green and Blue&nbsp;
 
|-
 
| 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''
 
|}
 
|}
  
  
===SetUnitAddress===
+
===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;" | '''SetUnitAddress'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteReg'''
 
|-
 
|-
| colspan="2" | Allows the component to taklk to more then one IC or broadcast to all connected ICs.&nbsp;
+
| colspan="2" | Writes data to one or more sequential registers&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 307: Line 313:
 
| width="90%" | Address
 
| width="90%" | Address
 
|-
 
|-
| colspan="2" | Range: 0-3 = Individual / 4 = Broadcast&nbsp;
+
| colspan="2" | &nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | Data
|}
 
 
 
 
 
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
| colspan="2" | &nbsp;
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
 
|-
 
|-
| colspan="2" | Starts up the I2C comms ready for communicating with the LP503x module. Must be called before any of the other component macros are called.&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Count
 
|-
 
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
 
| 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

Revision as of 12:02, 3 February 2023

Author Matrix TSL
Version 1.0
Category LEDs


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_temp/LP5036_RGB_LED.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_temp/LP5036_RGB_LED.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples




Macro reference

GetBrightness

Fc9-comp-macro.png GetBrightness
Gets the brightness of a single LED. 
Fc9-u8-icon.png - BYTE Address
Range: 0-11 
Fc9-u8-icon.png - BYTE RGB
Byte array containing at least 3 bytes to store Red, Green and Blue 
Fc9-u8-icon.png - BYTE Return


GetDiscreteRGB

Fc9-comp-macro.png GetDiscreteRGB
Gets the RGB format colour of a single LED. 
Fc9-u8-icon.png - BYTE Address
Range: 0-11 
Fc9-u8-icon.png - BYTE ColourIndex
 
Fc9-u8-icon.png - BYTE Return


GetRGB

Fc9-comp-macro.png GetRGB
Gets the RGB colour of a single LED. Array variables only. For individual variables, use GetDiscreteRGB 
Fc9-u8-icon.png - BYTE Address
Range: 0-11 
Fc9-u8-icon.png - BYTE RGB
Byte array containing at least 3 bytes to store Red, Green and Blue 
Fc9-void-icon.png - VOID Return


Initialise

Fc9-comp-macro.png 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. 
Fc9-void-icon.png - VOID Return


ReadReg

Fc9-comp-macro.png ReadReg
Reads the data from one or more sequential registers 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-u8-icon.png - BYTE Count
 
Fc9-void-icon.png - VOID Return


SetBrightness

Fc9-comp-macro.png SetBrightness
Allows the brightness of a single LED to be specified as a byte from 0 to 255. Default on reset is 255. 
Fc9-u8-icon.png - BYTE Address
Range: 0-11 
Fc9-u8-icon.png - BYTE Brightness
Brightness value: Range 0-255 
Fc9-void-icon.png - VOID Return


SetDiscreteRGB

Fc9-comp-macro.png SetDiscreteRGB
Allows the colour of a single LED to be specified in RGB format 
Fc9-u8-icon.png - BYTE Address
Range: 0-11 
Fc9-u8-icon.png - BYTE Red
 
Fc9-u8-icon.png - BYTE Green
 
Fc9-u8-icon.png - BYTE Blue
 
Fc9-void-icon.png - VOID Return


SetRGB

Fc9-comp-macro.png SetRGB
Allows the colour of a single LED to be specified in RGB. Array variables only. For individual variables and literal values, use SetDiscreteRGB 
Fc9-u8-icon.png - BYTE Address
Range: 0-11 
Fc9-u8-icon.png - BYTE RGB
Byte array containing at least 3 bytes to set Red, Green and Blue 
Fc9-void-icon.png - VOID Return


SetUnitAddress

Fc9-comp-macro.png SetUnitAddress
Allows the component to taklk to more then one IC or broadcast to all connected ICs. 
Fc9-u8-icon.png - BYTE Address
Range: 0-3 = Individual / 4 = Broadcast 
Fc9-void-icon.png - VOID Return


WriteReg

Fc9-comp-macro.png WriteReg
Writes data to one or more sequential registers 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-u8-icon.png - BYTE Count
 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Driver
Fc9-type-16-icon.png Driver IC
 
Fc9-type-16-icon.png Address Pins
 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-16-icon.png SDA Remap Pin
 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png SCL Remap Pin
 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms