Component: LED Cube (Misc Circuit)

From Flowcode Help
Jump to navigationJump to search
Author Ben Rowland 2014
Version 1.0
Category Misc Circuit


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

Fc9-comp-macro.png Clear
Clears the contents of the display to 0x0000  
Fc9-u8-icon.png - BYTE SwitchBuffers
0=DoNotSwitch 1=SwitchAutomaticallyWhenDone 
Fc9-void-icon.png - VOID Return


ConvColourToRGB

Fc9-comp-macro.png ConvColourToRGB
Reads the individual RGB colour values from a single UINT colour value. Return Index: 0=Red, 1=Green, 2=Blue 
Fc9-u16-icon.png - UINT Colour
 
Fc9-string-icon.png - STRING Return


ConvRGBToColour

Fc9-comp-macro.png ConvRGBToColour
Converts RGB values into a single UINT colour parameter to use with other functions. 
Fc9-u8-icon.png - BYTE Red
 
Fc9-u8-icon.png - BYTE Green
 
Fc9-u8-icon.png - BYTE Blue
 
Fc9-u16-icon.png - UINT Return


DisplayCharacter

Fc9-comp-macro.png DisplayCharacter
This macro allows a character to be displayed on the screen 
Fc9-u8-icon.png - BYTE Character
 
Fc9-u8-icon.png - BYTE X1
X pixel coordinate to set the output string position. 
Fc9-u8-icon.png - BYTE Y1
Y pixel coordinate to set the output string position. 
Fc9-u8-icon.png - BYTE Z1
 
Fc9-u8-icon.png - BYTE Font
Size of the font - 0 = Normal, 1 = Double Width, 2 = Double Width and Height, 3 = Double Height 
Fc9-u8-icon.png - BYTE Axis
0=XY, 1=XZ, 2=YZ 
Fc9-u8-icon.png - BYTE Orientation
0=Normal, 1=HFlip. 2=VFlip, 3=HFlip & VFlip 
Fc9-u16-icon.png - UINT Colour
Specifies the foreground colour 
Fc9-u8-icon.png - BYTE SwitchBuffers
 
Fc9-void-icon.png - VOID Return


DrawCuboid

Fc9-comp-macro.png DrawCuboid
Draws a basic 3D cuboid onto the LEDs 
Fc9-u8-icon.png - BYTE X1
 
Fc9-u8-icon.png - BYTE Y1
 
Fc9-u8-icon.png - BYTE Z1
 
Fc9-u8-icon.png - BYTE X2
 
Fc9-u8-icon.png - BYTE Y2
 
Fc9-u8-icon.png - BYTE Z2
 
Fc9-u8-icon.png - BYTE DrawStyle
Sets the draw style - 0=Soild, 1=Edge, 2=Corners 
Fc9-u16-icon.png - UINT Colour
 
Fc9-u8-icon.png - BYTE SwitchBuffers
 
Fc9-void-icon.png - VOID Return


DrawLine

Fc9-comp-macro.png DrawLine
Draws a basic 3D line onto the LEDs 
Fc9-u8-icon.png - BYTE X1
 
Fc9-u8-icon.png - BYTE Y1
 
Fc9-u8-icon.png - BYTE Z1
 
Fc9-u8-icon.png - BYTE X2
 
Fc9-u8-icon.png - BYTE Y2
 
Fc9-u8-icon.png - BYTE Z2
 
Fc9-u16-icon.png - UINT Colour
 
Fc9-u8-icon.png - BYTE SwitchBuffers
 
Fc9-void-icon.png - VOID Return


GetColour

Fc9-comp-macro.png 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 
Fc9-u8-icon.png - BYTE X
 
Fc9-u8-icon.png - BYTE Y
 
Fc9-u8-icon.png - BYTE Z
 
Fc9-u16-icon.png - UINT Return


Initialise

Fc9-comp-macro.png Initialise
Sets up the data memory and draws the simulated LED cube on the panel. 
Fc9-void-icon.png - VOID Return


PWMTimer

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


ResetRotations

Fc9-comp-macro.png ResetRotations
Resets the rotation count variables allowing for a new rotation to be started 
Fc9-void-icon.png - VOID Return


RotateDisplay

Fc9-comp-macro.png RotateDisplay
Shifts the contents of the display by the number of vertices specified 
Fc9-s16-icon.png - INT X
Number of pixels to shift the display -7 to 7 
Fc9-s16-icon.png - INT Y
Number of pixels to shift the display -7 to 7 
Fc9-s16-icon.png - INT Z
Number of pixels to shift the display -7 to 7 
Fc9-u8-icon.png - BYTE SwitchBuffers
 
Fc9-void-icon.png - VOID Return


RotateShellXY

Fc9-comp-macro.png RotateShellXY
Shifts the contents of the display by the number of vertices specified 
Fc9-u8-icon.png - BYTE Direction
 
Fc9-u8-icon.png - BYTE Shell
 
Fc9-void-icon.png - VOID Return


RotateShellXZ

Fc9-comp-macro.png RotateShellXZ
Shifts the contents of the display by the number of vertices specified 
Fc9-u8-icon.png - BYTE Direction
 
Fc9-u8-icon.png - BYTE Shell
 
Fc9-void-icon.png - VOID Return


RotateShellYZ

Fc9-comp-macro.png RotateShellYZ
Shifts the contents of the display by the number of vertices specified 
Fc9-u8-icon.png - BYTE Direction
 
Fc9-u8-icon.png - BYTE Shell
 
Fc9-void-icon.png - VOID Return


SetColour

Fc9-comp-macro.png SetColour
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 
Fc9-u8-icon.png - BYTE X
 
Fc9-u8-icon.png - BYTE Y
 
Fc9-u8-icon.png - BYTE Z
 
Fc9-u16-icon.png - UINT Colour
16-bit Colour Value (MSB B5, G6, R5 LSB) 
Fc9-void-icon.png - VOID Return


ShiftDisplay

Fc9-comp-macro.png ShiftDisplay
Shifts the contents of the display by the number of vertices specified 
Fc9-s16-icon.png - INT X
Number of pixels to shift the display -7 to 7 
Fc9-s16-icon.png - INT Y
Number of pixels to shift the display -7 to 7 
Fc9-s16-icon.png - INT Z
Number of pixels to shift the display -7 to 7 
Fc9-u8-icon.png - BYTE DataMode
0=ResetToZero, 1=WrapAroundDisplay, 2=Smear 
Fc9-u8-icon.png - BYTE SwitchBuffers
 
Fc9-void-icon.png - VOID Return


SwitchBuffers

Fc9-comp-macro.png SwitchBuffers
Switches the current display buffer to the updated buffer to allow for seamless updates when undergoing heavy calcaulations. 
Fc9-u8-icon.png - BYTE WaitForSwitch
0=DoNotWait, 1=Waits for switch to occur 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png LEDs
Fc9-type-21-icon.png Width (X)
The number of LEDs wide 
Fc9-type-21-icon.png Depth (Y)
The number of LEDs deep 
Fc9-type-21-icon.png Height (Z)
The number of LEDs tall 
Fc9-type-21-icon.png LED Count
Number of LEDs required by the component 
Fc9-type-16-icon.png LED Type
 
Fc9-type-16-icon.png Common Type
 
Fc9-type-16-icon.png Wiring Order
Specifies the order of the wiring of the LEDs from lowest bit to highest 
Fc9-type-21-icon.png Driver Pre Delay
Number of micro seconds to wait between switching off the driver and clocking out the new signals. Used to remove any ghosting effects visible on the display due to slow driver switch off times. 
Fc9-type-21-icon.png Driver Post Delay
Number of micro seconds to wait between switching off the driver and clocking out the new signals. Used to remove any ghosting effects visible on the display due to slow driver switch off times. 
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png Clock Pin
 
Fc9-type-19-icon.png Data Port
 
Fc9-type-19-icon.png Enable Port
 
Fc9-conn-icon.png Simulation
Fc9-type-15-icon.png LED Size
Size of each LED on the panel  
Fc9-type-15-icon.png Spacing
Number of units of spacing between each LED 
Fc9-type-7-icon.png Transparent
If set to yes then a LED which is completely switched off will be set to transparent, If set to no then the LED will be shown as black. 
Fc9-type-16-icon.png Toggle Pins
Determines if the pins are toggled as part of the PWMTimer macro during simulation. During simulation you probably don't want the pins toggling as it will slow down simulation. The only exception may be if you want to see the signals in the scope window. Does not effect the compiled embedded code.