Difference between revisions of "Component: RGB LED APA102C (LEDs)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_LED_APA102C.fcfx FC_Comp_Source_LED_APA102C.fcfx] |
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 40: | Line 42: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 62: | Line 66: | ||
==Macro reference== | ==Macro reference== | ||
+ | |||
+ | {| 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;" | '''SetBrightness''' | ||
+ | |- | ||
+ | | colspan="2" | 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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | Scaler | ||
+ | |- | ||
+ | | colspan="2" | Range: 0.0 to 1.0 Default: 1.0, 0 = Off, 0.5 = Half Brightness, 1.0 = Full Brightness | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''GetLEDColour''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the colour of a single LED in RAM as a 1D array. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | LED | ||
+ | |- | ||
+ | | colspan="2" | LED to change the colour / Range: 0 to (LED Count - 1) | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ColIdx | ||
+ | |- | ||
+ | | colspan="2" | 0 = R, 1 = G, 2 = B | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''SetBrightnessByte''' | ||
+ | |- | ||
+ | | colspan="2" | 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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Scaler | ||
+ | |- | ||
+ | | colspan="2" | Range: 0 to 255 Default: 255, 0 = Off, 128 = Half Brightness, 255 = Full Brightness | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''DrawLine2D''' | ||
+ | |- | ||
+ | | colspan="2" | Draws a line on a 2D array of LEDs | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | X1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Y1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | X2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Y2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | R | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | G | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | B | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''SetLEDColour''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the colour of a single LED in RAM as a 1D array. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | LED | ||
+ | |- | ||
+ | | colspan="2" | LED to change the colour / Range: 0 to (LED Count - 1) | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | R | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | G | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | B | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''SetAllLEDColour''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the colour of all the LEDs in RAM | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | R | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | G | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | B | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''Refresh''' | ||
+ | |- | ||
+ | | colspan="2" | Clocks out the current colour data to the LEDs from the values stored in RAM | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''ShiftLEDs1D''' | ||
+ | |- | ||
+ | | colspan="2" | Shifts the LED colours in 1D and wraps | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Direction | ||
+ | |- | ||
+ | | colspan="2" | 0 = Forwards, 1 = Backwards | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataMode | ||
+ | |- | ||
+ | | colspan="2" | 0=ResetToZero, 1=WrapAroundDisplay, 2=Smear | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''DrawLine3D''' | ||
+ | |- | ||
+ | | colspan="2" | Draws a line on a 3D array of LEDs | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | X1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Y1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Z1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | X2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Y2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Z2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | R | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | G | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | B | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''GetLEDIndex2D''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the index of a single LED in RAM as a 2D array. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | X | ||
+ | |- | ||
+ | | colspan="2" | LED Column to change the colour / Range: 0 to (LED Column - 1) | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Y | ||
+ | |- | ||
+ | | colspan="2" | LED Row to change the colour / Range: 0 to (LED Row - 1) | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''DrawRectangle2D''' | ||
+ | |- | ||
+ | | colspan="2" | Draws a basic 2D rectangle onto the LEDs | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | X1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Y1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | X2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Y2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DrawStyle | ||
+ | |- | ||
+ | | colspan="2" | Sets the draw style - 0=Soild, 1=Edge, 2=Corners | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | R | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | G | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | B | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''ShiftLEDs2D''' | ||
+ | |- | ||
+ | | colspan="2" | Shifts the contents of the display by the number of vertices specified ***Please Note that Wrap mode is currently unavailable*** | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | ||
+ | | width="90%" | X | ||
+ | |- | ||
+ | | colspan="2" | Number of pixels to shift the display -1 to 1 / 0 = No Shift | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | ||
+ | | width="90%" | Y | ||
+ | |- | ||
+ | | colspan="2" | Number of pixels to shift the display -1 to 1 / 0 = No Shift | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataMode | ||
+ | |- | ||
+ | | colspan="2" | 0=ResetToZero, 1=WrapAroundDisplay, 2=Smear | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''GetLEDIndex3D''' | ||
+ | |- | ||
+ | | colspan="2" | Gets the index of a single LED in RAM as a 3D array. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | X | ||
+ | |- | ||
+ | | colspan="2" | LED Column to change the colour / Range: 0 to (LED Column - 1) | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Y | ||
+ | |- | ||
+ | | colspan="2" | LED Row to change the colour / Range: 0 to (LED Row - 1) | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Z | ||
+ | |- | ||
+ | | colspan="2" | LED Layer to change the colour / Range: 0 to (LED Layer - 1) | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''DrawCuboid3D''' | ||
+ | |- | ||
+ | | colspan="2" | Draws a basic 3D cuboid onto the LEDs | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | X1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Y1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Z1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | X2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Y2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Z2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DrawStyle | ||
+ | |- | ||
+ | | colspan="2" | Sets the draw style - 0=Soild, 1=Edge, 2=Corners | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | R | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | G | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | B | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''Initialise''' | ||
+ | |- | ||
+ | | colspan="2" | Inisialises the RGB colour RAM to 0,0,0 = LED Off and clocks out the data to initialise all the WS2801 ICs in the chain. | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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;" | '''ShiftLEDs3D''' | ||
+ | |- | ||
+ | | colspan="2" | Shifts the contents of the display by the number of vertices specified ***Please Note that Wrap mode is currently unavailable*** | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | ||
+ | | width="90%" | X | ||
+ | |- | ||
+ | | colspan="2" | Number of pixels to shift the display -1 to 1 / 0 = No Shift | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | ||
+ | | width="90%" | Y | ||
+ | |- | ||
+ | | colspan="2" | Number of pixels to shift the display -1 to 1 / 0 = No Shift | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | ||
+ | | width="90%" | Z | ||
+ | |- | ||
+ | | colspan="2" | Number of pixels to shift the display -1 to 1 / 0 = No Shift | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataMode | ||
+ | |- | ||
+ | | colspan="2" | 0=ResetToZero, 1=WrapAroundDisplay, 2=Smear | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Property reference== | ||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
+ | | 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;" | LED Properties | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | LED Arrangement | ||
+ | |- | ||
+ | | colspan="2" | 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 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | LED Count | ||
+ | |- | ||
+ | | colspan="2" | Total number of LEDs in the design | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-15-icon.png]] | ||
+ | | width="90%" | Column Spacing | ||
+ | |- | ||
+ | | colspan="2" | X Spacing Between LEDs on the Panel | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | LED Current Usage | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Output Mode | ||
+ | |- | ||
+ | | colspan="2" | Sets the output mode used to drive the data to the LEDs Bit Banged Mode = Allows Any I/O Pin but may be slower SPI Mode = Fixed SPI Peripheral Pins but may be faster - Note that the SPI MISO pin will not be available for general I/O | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connection Properties | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | SPI Channel selector | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Prescale | ||
+ | |- | ||
+ | | colspan="2" | Prescale option selector | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | MOSI | ||
+ | |- | ||
+ | | colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | MISO | ||
+ | |- | ||
+ | | colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | CLK | ||
+ | |- | ||
+ | | colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Scope Traces | ||
+ | |- | ||
+ | | colspan="2" | Selects if the scope traces are automatically generated or not | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Console Data | ||
+ | |- | ||
+ | | colspan="2" | Selects if the console data is automatically generated or not | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | API | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 15:15, 20 January 2023
Author | Matrix TSL |
Version | 2.0 |
Category | LEDs |
Contents
RGB LED APA102C component
A simple chained RGB LED controller IC allowing multiple LEDs to be controlled using a serial data stream. Allows RGB LEDs to be driven with full 24-bit colour depth. Allows single chains, 2D arrays and 3D cube formations to be simulated. Supports Bit Banged or SPI peripheral based data modes.
Component Source Code
Please click here to view the component source code (Beta): FC_Comp_Source_LED_APA102C.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
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 = R, 1 = G, 2 = B | |
- BYTE | Return |
DrawLine2D | |
Draws a line on a 2D array of LEDs | |
- UINT | X1 |
- UINT | Y1 |
- UINT | X2 |
- UINT | Y2 |
- BYTE | R |
- BYTE | G |
- BYTE | B |
- 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 |
- BYTE | G |
- BYTE | B |
- VOID | Return |
SetAllLEDColour | |
Sets the colour of all the LEDs in RAM | |
- BYTE | R |
- BYTE | G |
- BYTE | B |
- 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 |
- UINT | Y1 |
- UINT | Z1 |
- UINT | X2 |
- UINT | Y2 |
- UINT | Z2 |
- BYTE | R |
- BYTE | G |
- BYTE | B |
- VOID | Return |
Initialise | |
Inisialises the RGB colour RAM to 0,0,0 = LED Off and clocks out the data to initialise all the WS2801 ICs in the chain. | |
- VOID | Return |
Property reference
==Macro reference==
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 = R, 1 = G, 2 = B | |
- BYTE | Return |
DrawLine2D | |
Draws a line on a 2D array of LEDs | |
- UINT | X1 |
- UINT | Y1 |
- UINT | X2 |
- UINT | Y2 |
- BYTE | R |
- BYTE | G |
- BYTE | B |
- 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 |
- BYTE | G |
- BYTE | B |
- VOID | Return |
SetAllLEDColour | |
Sets the colour of all the LEDs in RAM | |
- BYTE | R |
- BYTE | G |
- BYTE | B |
- 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 |
- UINT | Y1 |
- UINT | Z1 |
- UINT | X2 |
- UINT | Y2 |
- UINT | Z2 |
- BYTE | R |
- BYTE | G |
- BYTE | B |
- VOID | Return |
Initialise | |
Inisialises the RGB colour RAM to 0,0,0 = LED Off and clocks out the data to initialise all the WS2801 ICs in the chain. | |
- VOID | Return |