Jump to content

Component: LED Cube (Misc Circuit)

From Flowcode Help
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

Clear
Clears the contents of the display to 0x0000  
- BYTE SwitchBuffers
0=DoNotSwitch 1=SwitchAutomaticallyWhenDone 
- VOID Return


ConvColourToRGB

ConvColourToRGB
Reads the individual RGB colour values from a single UINT colour value. Return Index: 0=Red, 1=Green, 2=Blue 
- UINT Colour
 
- STRING Return


ConvRGBToColour

ConvRGBToColour
Converts RGB values into a single UINT colour parameter to use with other functions. 
- BYTE Red
 
- BYTE Green
 
- BYTE Blue
 
- UINT Return


DisplayCharacter

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


DrawCuboid

DrawCuboid
Draws a basic 3D cuboid onto the LEDs 
- BYTE X1
 
- BYTE Y1
 
- BYTE Z1
 
- BYTE X2
 
- BYTE Y2
 
- BYTE Z2
 
- BYTE DrawStyle
Sets the draw style - 0=Soild, 1=Edge, 2=Corners 
- UINT Colour
 
- BYTE SwitchBuffers
 
- VOID Return


DrawLine

DrawLine
Draws a basic 3D line onto the LEDs 
- BYTE X1
 
- BYTE Y1
 
- BYTE Z1
 
- BYTE X2
 
- BYTE Y2
 
- BYTE Z2
 
- UINT Colour
 
- BYTE SwitchBuffers
 
- VOID 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 
- BYTE X
 
- BYTE Y
 
- BYTE Z
 
- UINT Return


Initialise

Initialise
Sets up the data memory and draws the simulated LED cube on the panel. 
- VOID Return


PWMTimer

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) 
- VOID Return


ResetRotations

ResetRotations
Resets the rotation count variables allowing for a new rotation to be started 
- VOID Return


RotateDisplay

RotateDisplay
Shifts the contents of the display by the number of vertices specified 
- INT X
Number of pixels to shift the display -7 to 7 
- INT Y
Number of pixels to shift the display -7 to 7 
- INT Z
Number of pixels to shift the display -7 to 7 
- BYTE SwitchBuffers
 
- VOID Return


RotateShellXY

RotateShellXY
Shifts the contents of the display by the number of vertices specified 
- BYTE Direction
 
- BYTE Shell
 
- VOID Return


RotateShellXZ

RotateShellXZ
Shifts the contents of the display by the number of vertices specified 
- BYTE Direction
 
- BYTE Shell
 
- VOID Return


RotateShellYZ

RotateShellYZ
Shifts the contents of the display by the number of vertices specified 
- BYTE Direction
 
- BYTE Shell
 
- VOID Return


SetColour

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 
- BYTE X
 
- BYTE Y
 
- BYTE Z
 
- UINT Colour
16-bit Colour Value (MSB B5, G6, R5 LSB) 
- VOID Return


ShiftDisplay

ShiftDisplay
Shifts the contents of the display by the number of vertices specified 
- INT X
Number of pixels to shift the display -7 to 7 
- INT Y
Number of pixels to shift the display -7 to 7 
- INT Z
Number of pixels to shift the display -7 to 7 
- BYTE DataMode
0=ResetToZero, 1=WrapAroundDisplay, 2=Smear 
- BYTE SwitchBuffers
 
- VOID Return


SwitchBuffers

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


Property reference

Properties
LEDs
Width (X)
The number of LEDs wide 
Depth (Y)
The number of LEDs deep 
Height (Z)
The number of LEDs tall 
LED Count
Number of LEDs required by the component 
LED Type
 
Common Type
 
Wiring Order
Specifies the order of the wiring of the LEDs from lowest bit to highest 
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. 
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. 
Connections
Clock Pin
 
Data Port
 
Enable Port
 
Simulation
LED Size
Size of each LED on the panel  
Spacing
Number of units of spacing between each LED 
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. 
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.