Component: LED Matrix (HT16K33) (Outputs: LEDs)

From Flowcode Help
Jump to navigationJump to search
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