Difference between revisions of "Component: LED Cube (Misc Circuit)"
From Flowcode Help
Jump to navigationJump to search| (7 intermediate revisions by the same user not shown) | |||
| Line 17: | Line 17: | ||
==Component Source Code==  | ==Component Source Code==  | ||
| − | Please click here   | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_LEDCUBE.fcfx FC_Comp_Source_LEDCUBE.fcfx]  | 
| + | |||
| + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_LEDCUBE.fcfx FC_Comp_Source_LEDCUBE.fcfx]  | ||
==Detailed description==  | ==Detailed description==  | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| Line 30: | Line 40: | ||
==Examples==  | ==Examples==  | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| Line 39: | Line 57: | ||
''<span style="color:red;">No additional examples</span>''  | ''<span style="color:red;">No additional examples</span>''  | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
==Macro reference==  | ==Macro reference==  | ||
| + | ===Clear===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 61: | Line 90: | ||
| + | ===ConvColourToRGB===  | ||
{| 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;" | '''ConvColourToRGB'''  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" | Reads the individual RGB colour values from a single UINT colour value. Return Index: 0=Red, 1=Green, 2=Blue   | 
|-  | |-  | ||
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT  | 
| − | | width="90%" |   | + | | width="90%" | Colour  | 
|-  | |-  | ||
| colspan="2" |    | | colspan="2" |    | ||
|-  | |-  | ||
| − | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING  | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | | 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''  | ||
|}  | |}  | ||
| + | ===ConvRGBToColour===  | ||
{| 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;" | '''ConvRGBToColour'''  | 
| + | |-  | ||
| + | | colspan="2" | Converts RGB values into a single UINT colour parameter to use with other functions.   | ||
|-  | |-  | ||
| − | |||
|-  | |-  | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| + | | width="90%" | Red  | ||
| + | |-  | ||
| + | | 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" |    | ||
|-  | |-  | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-  | + | | 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''  | | width="90%" style="border-top: 2px solid #000;" | ''Return''  | ||
|}  | |}  | ||
| + | ===DisplayCharacter===  | ||
{| 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;" | '''DisplayCharacter'''  | 
| + | |-  | ||
| + | | colspan="2" | This macro allows a character to be displayed on the screen   | ||
| + | |-  | ||
|-  | |-  | ||
| − | |   | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| + | | width="90%" | Character  | ||
|-  | |-  | ||
| + | | colspan="2" |    | ||
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| width="90%" | X1  | | width="90%" | X1  | ||
|-  | |-  | ||
| − | | colspan="2" |    | + | | colspan="2" | X pixel coordinate to set the output string position.   | 
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| width="90%" | Y1  | | width="90%" | Y1  | ||
|-  | |-  | ||
| − | | colspan="2" |    | + | | colspan="2" | Y pixel coordinate to set the output string position.   | 
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| Line 131: | Line 168: | ||
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| − | | width="90%" |   | + | | width="90%" | Font  | 
|-  | |-  | ||
| − | | colspan="2" |    | + | | colspan="2" | Size of the font - 0 = Normal, 1 = Double Width, 2 = Double Width and Height, 3 = Double Height   | 
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| − | | width="90%" |   | + | | width="90%" | Axis  | 
|-  | |-  | ||
| − | | colspan="2" |    | + | | colspan="2" | 0=XY, 1=XZ, 2=YZ   | 
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| − | | width="90%" |   | + | | width="90%" | Orientation  | 
|-  | |-  | ||
| − | | colspan="2" |    | + | | colspan="2" | 0=Normal, 1=HFlip. 2=VFlip, 3=HFlip & VFlip   | 
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT  | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT  | ||
| width="90%" | Colour  | | width="90%" | Colour  | ||
|-  | |-  | ||
| − | | colspan="2" |    | + | | colspan="2" | Specifies the foreground colour   | 
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| Line 160: | Line 197: | ||
| + | ===DrawCuboid===  | ||
{| 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;" | '''DrawCuboid'''  | 
| + | |-  | ||
| + | | 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="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| − | | width="90%" |   | + | | width="90%" | Y1  | 
|-  | |-  | ||
| 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%" | Z1  | 
|-  | |-  | ||
| colspan="2" |    | | colspan="2" |    | ||
|-  | |-  | ||
| − | | width="10%" align="center  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| − | | width="90%  | + | | 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-  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| − | | width="90%" |   | + | | width="90%" | Z2  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" |    | 
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| − | | width="90%" |   | + | | width="90%" | DrawStyle  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" | Sets the draw style - 0=Soild, 1=Edge, 2=Corners   | 
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT  | 
| − | | width="90%" |   | + | | width="90%" | Colour  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" |    | 
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| Line 216: | Line 256: | ||
| + | ===DrawLine===  | ||
{| 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;" | '''DrawLine'''  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" | Draws a basic 3D line onto the LEDs   | 
|-  | |-  | ||
|-  | |-  | ||
| − | | width="10%" align="center  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| − | | width="90%  | + | | 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="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| − | | width="90%" |   | + | | width="90%" | Z1  | 
|-  | |-  | ||
| 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%" | X2  | 
|-  | |-  | ||
| 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%" | Y2  | 
|-  | |-  | ||
| colspan="2" |    | | colspan="2" |    | ||
|-  | |-  | ||
| − | | width="10%" align="center  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| − | | width="90%  | + | | width="90%" | Z2  | 
| − | |||
| − | |||
| − | |||
| − | |||
|-  | |-  | ||
| − | |   | + | | colspan="2" |    | 
| − | |||
|-  | |-  | ||
| − | |   | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT  | 
| + | | width="90%" | Colour  | ||
|-  | |-  | ||
| + | | colspan="2" |    | ||
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| − | | width="90%" |   | + | | width="90%" | SwitchBuffers  | 
|-  | |-  | ||
| 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-void-icon.png]] - VOID  | 
| width="90%" style="border-top: 2px solid #000;" | ''Return''  | | width="90%" style="border-top: 2px solid #000;" | ''Return''  | ||
|}  | |}  | ||
| + | ===GetColour===  | ||
{| 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;" | '''GetColour'''  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" | Reads the colour value from a single pixel in the active buffer as a 16-bit value. Bits 0-4 = Red Bits 5-10 = Green Bits 11-15 = Blue   | 
|-  | |-  | ||
|-  | |-  | ||
| Line 298: | Line 334: | ||
| colspan="2" |    | | colspan="2" |    | ||
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT  | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT  | 
| − | | width="90%" |   | + | | width="90%" style="border-top: 2px solid #000;" | ''Return''  | 
| + | |}  | ||
| + | |||
| + | |||
| + | ===Initialise===  | ||
| + | {| 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" | Sets up the data memory and draws the simulated LED cube on the panel.   | ||
|-  | |-  | ||
| − | |||
|-  | |-  | ||
| 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 308: | Line 353: | ||
| + | ===PWMTimer===  | ||
{| 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;" | '''PWMTimer'''  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" | Interrupt driven macro to clock out the signals to the LEDs in the cube. To be called as part of a high frequency hardware timer interrupt or software loop to drive the cube hardware, Min Frequency = 60(Hz) * 8(Height) * 32(5-bitColourChannelValue)   | 
|-  | |-  | ||
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID  | 
| − | | width="90%" |   | + | | width="90%" style="border-top: 2px solid #000;" | ''Return''  | 
| + | |}  | ||
| + | |||
| + | |||
| + | ===ResetRotations===  | ||
| + | {| 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;" | '''ResetRotations'''  | ||
|-  | |-  | ||
| − | |   | + | | colspan="2" | Resets the rotation count variables allowing for a new rotation to be started   | 
| − | |||
|-  | |-  | ||
| − | |||
|-  | |-  | ||
| − | + | | 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''  | ||
|}  | |}  | ||
| + | ===RotateDisplay===  | ||
{| 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;" | '''RotateDisplay'''  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" | Shifts the contents of the display by the number of vertices specified   | 
|-  | |-  | ||
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT  | 
| − | | width="90%" |   | + | | width="90%" | X  | 
|-  | |-  | ||
| − | | colspan="2" |    | + | | colspan="2" | Number of pixels to shift the display -7 to 7   | 
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT  | 
| − | | width="90%" |   | + | | width="90%" | Y  | 
|-  | |-  | ||
| − | | colspan="2" |    | + | | colspan="2" | Number of pixels to shift the display -7 to 7   | 
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT  | 
| − | | width="90%" |   | + | | width="90%" | Z  | 
|-  | |-  | ||
| − | | colspan="2" |    | + | | colspan="2" | Number of pixels to shift the display -7 to 7   | 
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| − | | width="90%" |   | + | | width="90%" | SwitchBuffers  | 
|-  | |-  | ||
| colspan="2" |    | | colspan="2" |    | ||
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID  | 
| − | | width="90%" |   | + | | width="90%" style="border-top: 2px solid #000;" | ''Return''  | 
| + | |}  | ||
| + | |||
| + | |||
| + | ===RotateShellXY===  | ||
| + | {| 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;" | '''RotateShellXY'''  | ||
|-  | |-  | ||
| − | |   | + | | colspan="2" | Shifts the contents of the display by the number of vertices specified   | 
| − | |||
|-  | |-  | ||
| − | |||
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| − | | width="90%" |   | + | | width="90%" | Direction  | 
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|-  | |-  | ||
| 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%" | Shell  | 
|-  | |-  | ||
| colspan="2" |    | | colspan="2" |    | ||
| Line 394: | Line 439: | ||
| + | ===RotateShellXZ===  | ||
{| 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;" | '''RotateShellXZ'''  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" | Shifts the contents of the display by the number of vertices specified   | 
|-  | |-  | ||
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| − | | width="90%" |   | + | | width="90%" | Direction  | 
|-  | |-  | ||
| 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%" | Shell  | 
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|-  | |-  | ||
| colspan="2" |    | | colspan="2" |    | ||
|-  | |-  | ||
| − | | width="10%" align="center" | [[File:Fc9-  | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID  | 
| − | | width="90%" |   | + | | width="90%" style="border-top: 2px solid #000;" | ''Return''  | 
| + | |}  | ||
| + | |||
| + | |||
| + | ===RotateShellYZ===  | ||
| + | {| 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;" | '''RotateShellYZ'''  | ||
|-  | |-  | ||
| − | |   | + | | colspan="2" | Shifts the contents of the display by the number of vertices specified   | 
| − | |||
|-  | |-  | ||
| − | |||
|-  | |-  | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | ||
| − | | width="90%" |   | + | | width="90%" | Direction  | 
|-  | |-  | ||
| − | | 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%" | Shell  | 
|-  | |-  | ||
| colspan="2" |    | | colspan="2" |    | ||
| Line 452: | Line 487: | ||
| + | ===SetColour===  | ||
{| 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;" | '''SetColour'''  | 
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" | Sets a pixel colour in the none active buffer using a 16-bit colour value Bits 0-4 = Red Bits 5-10 = Green Bits 11-15 = Blue   | 
|-  | |-  | ||
|-  | |-  | ||
| − | | width="10%" align="center  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| − | | width="90%  | + | | width="90%" | X  | 
| − | |||
| − | |||
| − | |||
| − | |||
|-  | |-  | ||
| − | |   | + | | colspan="2" |    | 
| − | |||
|-  | |-  | ||
| − | |   | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| + | | width="90%" | Y  | ||
|-  | |-  | ||
| + | | 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%" | Z  | 
| + | |-  | ||
| + | | colspan="2" |    | ||
| + | |-  | ||
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT  | ||
| + | | width="90%" | Colour  | ||
|-  | |-  | ||
| − | | colspan="2" |   | + | | colspan="2" | 16-bit Colour Value (MSB B5, G6, R5 LSB)   | 
|-  | |-  | ||
| 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 483: | Line 521: | ||
| + | ===ShiftDisplay===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 521: | Line 560: | ||
| + | ===SwitchBuffers===  | ||
{| 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;" | '''SwitchBuffers'''  | 
| + | |-  | ||
| + | | colspan="2" | Switches the current display buffer to the updated buffer to allow for seamless updates when undergoing heavy calcaulations.   | ||
| + | |-  | ||
|-  | |-  | ||
| − | |   | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE  | 
| + | | width="90%" | WaitForSwitch  | ||
|-  | |-  | ||
| + | | colspan="2" | 0=DoNotWait, 1=Waits for switch to occur   | ||
|-  | |-  | ||
| 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 13:11, 7 February 2023
| Author | Ben Rowland 2014 | 
| Version | 1.0 | 
| Category | Misc Circuit | 
Contents
LED Cube component
LED Cube component for driving 3D arrays of LEDs. A typical cube could consist of 4x4x4 or 8x8x8 but does not necessarily need to be a cuboid.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_LEDCUBE.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_LEDCUBE.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
Clear
| Clear | |
| Clears the contents of the display to 0x0000 | |
| SwitchBuffers | |
| 0=DoNotSwitch 1=SwitchAutomaticallyWhenDone | |
| Return | |
ConvColourToRGB
| ConvColourToRGB | |
| Reads the individual RGB colour values from a single UINT colour value. Return Index: 0=Red, 1=Green, 2=Blue | |
| Colour | |
| Return | |
ConvRGBToColour
| ConvRGBToColour | |
| Converts RGB values into a single UINT colour parameter to use with other functions. | |
| Red | |
| Green | |
| Blue | |
| Return | |
DisplayCharacter
DrawCuboid
DrawLine
| DrawLine | |
| Draws a basic 3D line onto the LEDs | |
| X1 | |
| Y1 | |
| Z1 | |
| X2 | |
| Y2 | |
| Z2 | |
| Colour | |
| SwitchBuffers | |
| Return | |
GetColour
| GetColour | |
| Reads the colour value from a single pixel in the active buffer as a 16-bit value. Bits 0-4 = Red Bits 5-10 = Green Bits 11-15 = Blue | |
| X | |
| Y | |
| Z | |
| Return | |
Initialise
| Initialise | |
| Sets up the data memory and draws the simulated LED cube on the panel. | |
| Return | |
PWMTimer
ResetRotations
| ResetRotations | |
| Resets the rotation count variables allowing for a new rotation to be started | |
| Return | |
RotateDisplay
RotateShellXY
| RotateShellXY | |
| Shifts the contents of the display by the number of vertices specified | |
| Direction | |
| Shell | |
| Return | |
RotateShellXZ
| RotateShellXZ | |
| Shifts the contents of the display by the number of vertices specified | |
| Direction | |
| Shell | |
| Return | |
RotateShellYZ
| RotateShellYZ | |
| Shifts the contents of the display by the number of vertices specified | |
| Direction | |
| Shell | |
| Return | |
SetColour
ShiftDisplay
SwitchBuffers