Jump to content

Component: RGB LED SK6812 RGBW (LEDs): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 15: Line 15:
A simple chained RGBW LED controller IC allowing multiple LEDs to be controlled using a serial data stream. Compatible with the SK6812 RGBW Type Controller ICs. Allows RGBW LEDs to be driven with full 24-bit colour depth plus 8-bit white channel. Allows single chains, 2D arrays and 3D cube formations to be simulated. Requires a high speed microcontroller to generate the critical timings to drive the device.
A simple chained RGBW LED controller IC allowing multiple LEDs to be controlled using a serial data stream. Compatible with the SK6812 RGBW Type Controller ICs. Allows RGBW LEDs to be driven with full 24-bit colour depth plus 8-bit white channel. Allows single chains, 2D arrays and 3D cube formations to be simulated. Requires a high speed microcontroller to generate the critical timings to drive the device.


==Component Pack==
==Component Source Code==


BASICIO
Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_LED_SK6812RGBW.fcfx FC_Comp_Source_LED_SK6812RGBW.fcfx]


==Detailed description==
==Detailed description==




Line 34: Line 36:


==Examples==
==Examples==




Line 685: Line 689:
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Controller IC
|-
|-
|-
|-
Line 721: Line 729:
|-
|-
| colspan="2" | Logic 1 low time in microseconds 
| colspan="2" | Logic 1 low time in microseconds 
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | LED Properties
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Line 731: Line 743:
|-
|-
| colspan="2" | Total number of LEDs in the design 
| colspan="2" | Total number of LEDs in the design 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Arrangement
|-
| colspan="2" | LEDs will likely be arranged in one of two ways. Parallel = Each row of LEDs run from left to right - easier to address but harder to wire. Alternating = Each row of LEDs runs in an alternating direction - harder to address but easier to wire. 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Column Count
|-
| colspan="2" | Number of horizontal LEDs - X axis 
|-
|-
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
Line 747: Line 749:
| colspan="2" | X Spacing Between LEDs on the Panel 
| colspan="2" | X Spacing Between LEDs on the Panel 
|-
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Row Count
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
|-
| colspan="2" | Number of vertical LEDs - Y axis 
|-
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| width="90%" | Row Spacing
|-
| colspan="2" | Y Spacing Between LEDs on the Panel 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Layer Count
|-
| colspan="2" | Number of LED layers - Z axis 
|-
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| width="90%" | Layer Spacing
|-
| colspan="2" | Z Spacing Between LEDs on the Panel 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Flip X
|-
| colspan="2" | Flips the X axis if the LEDs are wired from the right hand side of the display. 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Flip Y
|-
| colspan="2" | Flips the Y axis if the LEDs are wired from the under side of the display. 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Flip Z
|-
| colspan="2" | Flips the X axis if the LEDs are wired from the upper most side of the display. 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
|-
|-
|-
|-
Line 790: Line 757:
|-
|-
| colspan="2" | LED Data Pin - Connected to the Data In pin of the first WS821x IC. 
| colspan="2" | LED Data Pin - Connected to the Data In pin of the first WS821x IC. 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|}
|}

Revision as of 17:48, 9 November 2022

Author Matrix TSL
Version 1.5
Category LEDs


RGB LED SK6812 RGBW component

A simple chained RGBW LED controller IC allowing multiple LEDs to be controlled using a serial data stream. Compatible with the SK6812 RGBW Type Controller ICs. Allows RGBW LEDs to be driven with full 24-bit colour depth plus 8-bit white channel. Allows single chains, 2D arrays and 3D cube formations to be simulated. Requires a high speed microcontroller to generate the critical timings to drive the device.

Component Source Code

Please click here for the component source code: FC_Comp_Source_LED_SK6812RGBW.fcfx

Detailed description

No detailed description exists yet for this component

Examples

LEDs can be wired either active high or active low. The LED components should each have a property allowing you to configure which LED type your using.


An active high LED will light when the microcontroller pin is outputting a logic 1 and be off when the microcontroller pin is outputting a logic 0 or in input mode.


An active low LED will light when the microcontroller pin is outputting a logic 0 and be off when the microcontroller pin is outputting a logic 1 or in input mode.


The series resistor can be on either side of the LED and acts to protect the LED from damage due to excess current. 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

Downloadable macro reference

SetBrightness
Allows the output colour brightness of the LEDs to be scaled down. For example to save current usage or to reduce brightness in dark environments.  
- FLOAT Scaler
Range: 0.0 to 1.0 Default: 1.0, 0 = Off, 0.5 = Half Brightness, 1.0 = Full Brightness 
- VOID Return


GetLEDColour
Sets the colour of a single LED in RAM as a 1D array. 
- UINT LED
LED to change the colour / Range: 0 to (LED Count - 1) 
- BYTE ColIdx
0 = Red, 1 = Green, 2 = Blue, 3 = White 
- BYTE Return


OutputLow
 
- VOID Return


SetBrightnessByte
Allows the output colour brightness of the LEDs to be scaled down. For example to save current usage or to reduce brightness in dark environments.  
- BYTE Scaler
Range: 0 to 255 Default: 255, 0 = Off, 128 = Half Brightness, 255 = Full Brightness 
- VOID Return


Delay_T0L
 
- VOID Return


DrawLine2D
Draws a line on a 2D array of LEDs 
- UINT X1
Start X Coordinate 
- UINT Y1
Start Y Coordinate 
- UINT X2
End X Coordinate 
- UINT Y2
End Y Coordinate 
- BYTE R
Red colour channel 
- BYTE G
Green colour channel 
- BYTE B
Blue colour channel 
- BYTE W
White colour channel 
- VOID Return


OutputHigh
 
- VOID Return


SetLEDColour
Sets the colour of a single LED in RAM as a 1D array. 
- UINT LED
LED to change the colour / Range: 0 to (LED Count - 1) 
- BYTE R
Red Colour Channel 
- BYTE G
Green Colour Channel 
- BYTE B
Blue Colour Channel 
- BYTE W
White Colour Channel 
- VOID Return


SetAllLEDColour
Sets the colour of all the LEDs in RAM 
- BYTE R
Red Colour Channel 
- BYTE G
Green Colour Channel 
- BYTE B
Blue Colour Channel 
- BYTE W
White colour channel 
- VOID Return


Delay_T0H
 
- VOID Return


Delay_T1L
 
- VOID Return


Refresh
Clocks out the current colour data to the LEDs from the values stored in RAM 
- VOID Return


ShiftLEDs1D
Shifts the LED colours in 1D and wraps  
- BYTE Direction
0 = Forwards, 1 = Backwards 
- BYTE DataMode
0=ResetToZero, 1=WrapAroundDisplay, 2=Smear 
- VOID Return


DrawLine3D
Draws a line on a 3D array of LEDs 
- UINT X1
Start X Coordinate 
- UINT Y1
Start Y Coordinate 
- UINT Z1
Start Z Coordinate 
- UINT X2
End X Coordinate 
- UINT Y2
End Y Coordinate 
- UINT Z2
End Z Coordinate 
- BYTE R
Red Colour Channel 
- BYTE G
Green Colour Channel 
- BYTE B
Blue Colour Channel 
- BYTE W
White Colour Channel 
- VOID Return


Delay_T1H
 
- VOID Return


GetLEDIndex2D
Sets the index of a single LED in RAM as a 2D array. 
- UINT X
LED Column to change the colour / Range: 0 to (LED Column - 1) 
- UINT Y
LED Row to change the colour / Range: 0 to (LED Row - 1) 
- UINT Return


DrawRectangle2D
Draws a basic 2D rectangle onto the LEDs 
- BYTE X1
 
- BYTE Y1
 
- BYTE X2
 
- BYTE Y2
 
- BYTE DrawStyle
Sets the draw style - 0=Soild, 1=Edge, 2=Corners 
- BYTE R
 
- BYTE G
 
- BYTE B
 
- BYTE W
White Colour Channel 
- VOID Return


ShiftLEDs2D
Shifts the contents of the display by the number of vertices specified ***Please Note that Wrap mode is currently unavailable*** 
- INT X
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
- INT Y
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
- BYTE DataMode
0=ResetToZero, 1=WrapAroundDisplay, 2=Smear 
- VOID Return


GetLEDIndex3D
Gets the index of a single LED in RAM as a 3D array. 
- UINT X
LED Column to change the colour / Range: 0 to (LED Column - 1) 
- UINT Y
LED Row to change the colour / Range: 0 to (LED Row - 1) 
- UINT Z
LED Layer to change the colour / Range: 0 to (LED Layer - 1) 
- UINT Return


DrawCuboid3D
Draws a basic 3D cuboid onto the LEDs 
- BYTE X1
Start X pixel coordinate 
- BYTE Y1
Start Y pixel coordinate 
- BYTE Z1
Start Z pixel coordinate 
- BYTE X2
End X pixel coordinate 
- BYTE Y2
End Y pixel coordinate 
- BYTE Z2
End Z pixel coordinate 
- BYTE DrawStyle
Sets the draw style - 0=Soild, 1=Edge, 2=Corners 
- BYTE R
Red Colour Channel 
- BYTE G
Green Colour Channel 
- BYTE B
White Colour Channel 
- BYTE W
White Colour Channel 
- VOID Return


Initialise
Inisialises the RGB colour RAM to 0,0,0 = LED Off and clocks out the data to initialise all the LED ICs in the chain. 
- VOID Return


ShiftLEDs3D
Shifts the contents of the display by the number of vertices specified ***Please Note that Wrap mode is currently unavailable*** 
- INT X
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
- INT Y
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
- INT Z
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
- BYTE DataMode
0=ResetToZero, 1=WrapAroundDisplay, 2=Smear 
- VOID Return



Property reference

Properties
Controller IC
LED Controller
Allows the user to select which LED controller IC they are using. The different controller ICs all work the same way but have different timing characteristics. 
Data Order
Configures the order the colour data is clocked out to the LEDs 
Reset Time (uS)
Blanking reset period to reset the LED shift chain and start from the beginning 
T0H (uS)
Logic 0 high time in microseconds 
T0L (uS)
Logic 0 low time in microseconds 
T1H (uS)
Logic 1 high time in microseconds 
T1L (uS)
Logic 1 low time in microseconds 
LED Properties
LED Arrangement
Controls the arrangement of the LEDs on the panel. 1D - Creates a straight line of LEDs 2D - Creates an X by Y Array of LEDs 3D - Creates an X by Y by Z Array of LEDs 
LED Count
Total number of LEDs in the design 
Column Spacing
X Spacing Between LEDs on the Panel 
Connections
Data Pin
LED Data Pin - Connected to the Data In pin of the first WS821x IC.