Component: LED WS2801 (Outputs: LEDs)
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | Outputs: LEDs |
Contents
- 1 LED WS2801 component
- 2 Examples
- 3 Downloadable macro reference
- 3.1 <span style="font-weight: normal;"><u><tt>DrawLine2D</tt></u></span>
- 3.2 <span style="font-weight: normal;"><u><tt>SetAllLEDColour</tt></u></span>
- 3.3 <span style="font-weight: normal;"><u><tt>SetLEDColour</tt></u></span>
- 3.4 <span style="font-weight: normal;"><u><tt>Refresh</tt></u></span>
- 3.5 <span style="font-weight: normal;"><u><tt>DrawLine3D</tt></u></span>
- 3.6 <span style="font-weight: normal;"><u><tt>SetLEDColour2D</tt></u></span>
- 3.7 <span style="font-weight: normal;"><u><tt>SetLEDColour3D</tt></u></span>
- 3.8 <span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>
- 4 Simulation macro reference
- 5 Property reference
LED WS2801 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.
Examples
''<span style="color:red;">No additional examples</span>''
Downloadable macro reference
<span style="font-weight: normal;"><u><tt>DrawLine2D</tt></u></span>
Draws a line on a 2D array of LEDs
'''Parameters'''
- UINT ''X1''
- UINT ''Y1''
- UINT ''X2''
- UINT ''Y2''
- BYTE ''R''
- BYTE ''G''
- BYTE ''B''
'''Return value'''
- ''This call does not return a value''
<span style="font-weight: normal;"><u><tt>SetAllLEDColour</tt></u></span>
Sets the colour of all the LEDs in RAM
'''Parameters'''
- BYTE ''R''
- BYTE ''G''
- BYTE ''B''
'''Return value'''
- ''This call does not return a value''
<span style="font-weight: normal;"><u><tt>SetLEDColour</tt></u></span>
Sets the colour of a single LED in RAM as a 1D array.
'''Parameters'''
- UINT ''LED''
- LED to change the colour / Range: 0 to (LED Count - 1)
- BYTE ''R''
- BYTE ''G''
- BYTE ''B''
'''Return value'''
- ''This call does not return a value''
<span style="font-weight: normal;"><u><tt>Refresh</tt></u></span>
Clocks out the current colour data to the LEDs from the values stored in RAM
'''Parameters'''
- ''This macro has no parameters''
'''Return value'''
- ''This call does not return a value''
<span style="font-weight: normal;"><u><tt>DrawLine3D</tt></u></span>
Draws a line on a 3D array of LEDs
'''Parameters'''
- UINT ''X1''
- UINT ''Y1''
- UINT ''Z1''
- UINT ''X2''
- UINT ''Y2''
- UINT ''Z2''
- BYTE ''R''
- BYTE ''G''
- BYTE ''B''
'''Return value'''
- ''This call does not return a value''
<span style="font-weight: normal;"><u><tt>SetLEDColour2D</tt></u></span>
Sets the colour of a single LED in RAM as a 2D array.
'''Parameters'''
- UINT ''LED_Column''
- LED Column to change the colour / Range: 0 to (LED Column - 1)
- UINT ''LED_Row''
- LED Row to change the colour / Range: 0 to (LED Row - 1)
- BYTE ''R''
- BYTE ''G''
- BYTE ''B''
'''Return value'''
- ''This call does not return a value''
<span style="font-weight: normal;"><u><tt>SetLEDColour3D</tt></u></span>
Sets the colour of a single LED in RAM as a 3D array.
'''Parameters'''
- UINT ''LED_Column''
- LED Column to change the colour / Range: 0 to (LED Column - 1)
- UINT ''LED_Row''
- LED Row to change the colour / Range: 0 to (LED Row - 1)
- UINT ''LED_Layer''
- LED Layer to change the colour / Range: 0 to (LED Layer - 1)
- BYTE ''R''
- BYTE ''G''
- BYTE ''B''
'''Return value'''
- ''This call does not return a value''
<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>
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.
'''Parameters'''
- ''This macro has no parameters''
'''Return value'''
- ''This call does not return a value''
Simulation macro reference
''This component does not contain any simulation macros''
Property reference
<span style="font-weight: normal;"><u>LED Arrangement</u></span>
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''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
<span style="font-weight: normal;"><u>LED Count</u></span>
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''LED_Count''.
Total number of LEDs in the design
<span style="font-weight: normal;"><u>LED Columns</u></span>
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''LED_Cols''.
Number of horizontal LEDs - X axis
<span style="font-weight: normal;"><u>LED Rows</u></span>
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''LED_Rows''.
Number of vertical LEDs - Y axis
<span style="font-weight: normal;"><u>LED Layers</u></span>
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''LED_Layers''.
Number of LED layers - Z axis
<span style="font-weight: normal;"><u>Output Mode</u></span>
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Output_Mode''.
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
<span style="font-weight: normal;"><u>Data Pin</u></span>
This property is of type ''Single digital pin'' and can be referenced with the variable name ''MOSI''.
LED Data Pin - Connected to the Data In pin of the first WS8201 IC.
<span style="font-weight: normal;"><u>Clock Pin</u></span>
This property is of type ''Single digital pin'' and can be referenced with the variable name ''CLK''.
LED Clock Pin - Connected to the Clock In pin of the first WS8201 IC.