Difference between revisions of "Component: LED Matrix (HT16K33) (Outputs: LEDs)"

From Flowcode Help
Jump to navigationJump to search
(XML import - Pre 8.0 release)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
  
 
{| width="50%"
 
{| width="50%"
Line 7: Line 6:
 
|-
 
|-
 
| width="20%" style="color: gray;" | Version
 
| width="20%" style="color: gray;" | Version
| 1.0 (Release)
+
| 1.2 (Release)
 
|-
 
|-
 
| width="20%" style="color: gray;" | Category
 
| width="20%" style="color: gray;" | Category
Line 18: Line 17:
 
LED Matrix component designed to work using a HT16K33 LED driver IC.
 
LED Matrix component designed to work using a HT16K33 LED driver IC.
 
Can drive up to 16 x 8 (128) LEDs.
 
Can drive up to 16 x 8 (128) LEDs.
 +
Includes support for 8x16 Backpack, 16x8 Featherwing, 8x8 Backpack and Custom.
  
 
==Examples==
 
==Examples==
''<span style="color:red;">No additional examples</span>''
+
 
 +
Example to display a bitmap image on the LED matrix using the Bitmap Drawer component.
 +
 
 +
[[File:HT16K33_Bitmap.zip]]
  
  
Line 42: Line 45:
 
:[[Variable Types|BYTE]] ''Add_Spaces''
 
:[[Variable Types|BYTE]] ''Add_Spaces''
 
::Add spaces between each ASCII character 0=No, 1=Yes
 
::Add spaces between each ASCII character 0=No, 1=Yes
 +
 +
:[[Variable Types|BYTE]] ''Orientation''
 +
::0=Normal, 1=Rotated 90 Degrees
  
  
Line 64: Line 70:
  
 
===<span style="font-weight: normal;"><u><tt>ShiftColumns</tt></u></span>===
 
===<span style="font-weight: normal;"><u><tt>ShiftColumns</tt></u></span>===
Shifts the columns one place to the right.  
+
Shifts the columns one place left or right.  
  
 
Used for things like displaying scrolling text.
 
Used for things like displaying scrolling text.
Line 93: Line 99:
  
 
===<span style="font-weight: normal;"><u><tt>WriteLED</tt></u></span>===
 
===<span style="font-weight: normal;"><u><tt>WriteLED</tt></u></span>===
Allows a single LED to be controlled.
+
Allows a single LED to be controlled using the basic column / row coordinate system.
 +
 
 +
Each column is comprised of 8 rows.
  
 
'''Parameters'''
 
'''Parameters'''
 +
 +
:[[Variable Types|BYTE]] ''Column''
 +
::Range: 0-15
 +
 +
:[[Variable Types|BYTE]] ''Row''
 +
::Range: 0-7
  
 
:[[Variable Types|BYTE]] ''Data''
 
:[[Variable Types|BYTE]] ''Data''
 
::0 = LED Off, 1 = LED On
 
::0 = LED Off, 1 = LED On
  
:[[Variable Types|BYTE]] ''Row''
 
::Range: 0-7
 
  
:[[Variable Types|BYTE]] ''Column''
+
'''Return value'''
::Range: 0-15
+
 
 +
:''This call does not return a value''
 +
 
 +
 
 +
===<span style="font-weight: normal;"><u><tt>WriteLEDXY</tt></u></span>===
 +
Allows a single LED to be controlled using a more standard X, Y coordinate system.
 +
 
 +
0,0 refers to the bottom left hand LED.
 +
 
 +
Only works with the fixed display modules, custom module not supported.
 +
 
 +
'''Parameters'''
 +
 
 +
:[[Variable Types|BYTE]] ''X''
 +
::X coordinate. Range: 0-15
 +
 
 +
:[[Variable Types|BYTE]] ''Y''
 +
::Y coordinate. Range: 0-15
 +
 
 +
:[[Variable Types|BYTE]] ''State''
 +
::State 0=Off, 1=On
  
  
Line 126: Line 158:
  
 
===<span style="font-weight: normal;"><u><tt>WriteColumn</tt></u></span>===
 
===<span style="font-weight: normal;"><u><tt>WriteColumn</tt></u></span>===
Allows a single column of data to be inserted, Acts to shift the rest of the columns across by one.
+
Allows a single column of 8 LEDs to be controlled in a single action.
  
 
'''Parameters'''
 
'''Parameters'''
 +
 +
:[[Variable Types|BYTE]] ''Column''
 +
::Range: 0-15
  
 
:[[Variable Types|BYTE]] ''Data''
 
:[[Variable Types|BYTE]] ''Data''
 
::Data to display on the column of LEDs
 
::Data to display on the column of LEDs
 
:[[Variable Types|BYTE]] ''Column''
 
::Range: 0-15
 
  
  
Line 177: Line 209:
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>LED Type</u></span>
+
<span style="font-weight: normal;"><u>Display Module</u></span>
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''led_type''.
+
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Module''.
  
Active high outputs a logic 1 to set the LED and logic 0 to clear the LED.
+
''<span style="color:red;">No additional information</span>''
 
 
Active low outputs a logic 0 to set the LED and logic 1 to clear the LED
 
 
 
<span style="font-weight: normal;"><u>Row Count</u></span>
 
 
 
This property is of type ''Signed integer'' and can be referenced with the variable name ''num_rows''.
 
 
 
Number of LED rows
 
 
 
<span style="font-weight: normal;"><u>Column Count</u></span>
 
  
This property is of type ''Signed integer'' and can be referenced with the variable name ''num_cols''.
 
  
Number of LED columns
 
  
 
<span style="font-weight: normal;"><u>LED Count</u></span>
 
<span style="font-weight: normal;"><u>LED Count</u></span>
Line 312: Line 332:
  
 
Simulated LED basic shape
 
Simulated LED basic shape
 
<span style="font-weight: normal;"><u>Redraw LEDs</u></span>
 
 
This property is of type ''True or false'' and can be referenced with the variable name ''redraw''.
 
 
Simulated LED redraw option, display will not be updated until the redraw is set to Yes.
 
 
Automatically revers back to No after the refresh has been performed.
 
  
 
<span style="font-weight: normal;"><u>Scope Traces</u></span>
 
<span style="font-weight: normal;"><u>Scope Traces</u></span>

Latest revision as of 14:09, 8 June 2018

Author Matrix Ltd
Version 1.2 (Release)
Category Outputs: LEDs


Image LED Matrix (HT16K33) component

LED Matrix component designed to work using a HT16K33 LED driver IC. Can drive up to 16 x 8 (128) LEDs. Includes support for 8x16 Backpack, 16x8 Featherwing, 8x8 Backpack and Custom.

Examples

Example to display a bitmap image on the LED matrix using the Bitmap Drawer component.

File:HT16K33 Bitmap.zip


Downloadable macro reference

DisplayString

Prints an ASCII string onto the LED Matrix a column at a time.

Parameters

<- STRING Data
Data string to display on the LEDs
This parameter may be returned back to the caller
UINT Animation_Delay
Delay in milliseconds between writing to the next column
BYTE Leadout
Allows the text to scroll completely off the display before returning 0=No, 1=Yes
BYTE Add_Spaces
Add spaces between each ASCII character 0=No, 1=Yes
BYTE Orientation
0=Normal, 1=Rotated 90 Degrees


Return value

This call does not return a value


SetBrightness

Configures the brightness of the LEDs by varying the On portion of the duty.

Parameters

BYTE Brightness
Range: 0-15 - 0 = Min Brightness, 15 = Full Brightness


Return value

This call does not return a value


ShiftColumns

Shifts the columns one place left or right.

Used for things like displaying scrolling text.

Parameters

BYTE Direction
0 = Shift Left, 1 = Shift Right


Return value

This call does not return a value


ClearLEDs

Sets all of the LEDs in the matrix to the off state.

Parameters

This macro has no parameters


Return value

This call does not return a value


WriteLED

Allows a single LED to be controlled using the basic column / row coordinate system.

Each column is comprised of 8 rows.

Parameters

BYTE Column
Range: 0-15
BYTE Row
Range: 0-7
BYTE Data
0 = LED Off, 1 = LED On


Return value

This call does not return a value


WriteLEDXY

Allows a single LED to be controlled using a more standard X, Y coordinate system.

0,0 refers to the bottom left hand LED.

Only works with the fixed display modules, custom module not supported.

Parameters

BYTE X
X coordinate. Range: 0-15
BYTE Y
Y coordinate. Range: 0-15
BYTE State
State 0=Off, 1=On


Return value

This call does not return a value


WriteCommand

Writes a command.

Parameters

BYTE Command


Return value

This call does not return a value


WriteColumn

Allows a single column of 8 LEDs to be controlled in a single action.

Parameters

BYTE Column
Range: 0-15
BYTE Data
Data to display on the column of LEDs


Return value

This call does not return a value


WriteRegister

Writes a value to a register.

Parameters

BYTE Address
BYTE Value


Return value

This call does not return a value


Initialise

Configures the I2C peripheral and sets up the HT16K33 IC ready to drive the LEDs.

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

Display Module

This property is of type Fixed list of ints and can be referenced with the variable name Module.

No additional information


LED Count

This property is of type Signed integer and can be referenced with the variable name led_cnt.

Total number of LEDs in the component

Slave Address

This property is of type Fixed list of ints and can be referenced with the variable name SlaveAddress.

No additional information


Channel

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::CHANNEL.

Channel selection

Baud Select

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::BAUD_LIST.

Baud rate option selector

Baud Rate

This property is of type Signed integer and can be referenced with the variable name cal_i2c1::BAUD.

Baud rate to be used

Stop Delay

This property is of type True or false and can be referenced with the variable name cal_i2c1::StopDel.

On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not

a 10ms delay between an I2C stop event and the next I2C start event.


Most modern microcontrollers will not have a problem so this property can be disabled to speed up the

I2C communications.

SDA

This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SDA.

Pin used for SDA (data signal)

SCL

This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SCL.

Pin used for SCL (clock signal)

On Color

This property is of type Color picker and can be referenced with the variable name on_col.

Simulated colour of the LEDs when switched On

Off Color

This property is of type Color picker and can be referenced with the variable name off_col.

Simulated colour of the LEDs when switched Off

Simulation Type

This property is of type Fixed list of ints and can be referenced with the variable name SimType.

Sets the simulation type.

Component GUI allows the object on the panel to reflect what the reakl life LED matrix should do.

I2C Injector allows the I2C communications to be simulated via injectors.

Column Spacing

This property is of type Floating point and can be referenced with the variable name col_spacing.

Simulation column spacing

Width

This property is of type Floating point and can be referenced with the variable name width.

Simulation LED width

Row Spacing

This property is of type Floating point and can be referenced with the variable name row_spacing.

Simulation row spacing

Height

This property is of type Floating point and can be referenced with the variable name height.

Simulated LED height

Depth

This property is of type Floating point and can be referenced with the variable name depth.

Simulated LED Depth (3D environments only)

LED Shape

This property is of type Fixed list of ints and can be referenced with the variable name Shape.

Simulated LED basic shape

Scope Traces

This property is of type True or false and can be referenced with the variable name cal_i2c1::ScopeTraces.

Selects if the scope traces are automatically generated or not

Console Data

This property is of type True or false and can be referenced with the variable name cal_i2c1::ConsoleData.

Selects if the console data is automatically generated or not

Injector

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::Injector.

No additional information