Jump to content

Component: LED Matrix (HT16K33) (LEDs)

From Flowcode Help
Revision as of 14:36, 13 July 2026 by SteveT (talk | contribs) (Text replacement - "style="background-color:#EAE1EA; color:#4B008D;"" to "class="mtx-class-propfolder"")
Author Matrix Ltd
Version 2.0
Category LEDs


LED Matrix 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.

Version information

Library Version, Component Version, Date, Author, Info
12, 1.0, 12-03-25, MW, Modified  component icon to look better in dark mode
 


Detailed description

No detailed description exists yet for this component

Examples

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

File:HT16K33 Bitmap.zip







Macro reference

ChangeAddress

ChangeAddress
Change the address and Configures the I2C peripheral and sets up the HT16K33 IC ready to drive the LEDs. Returns 0 for fail & 1 for success. 
- BYTE SlaveAddress
New slave address 0x70 - 0x78 (112-120) 
- BOOL Return


ClearLEDs

ClearLEDs
Sets all of the LEDs in the matrix to the off state. 
- VOID Return


DisplayString

DisplayString
Prints an ASCII string onto the LED Matrix a column at a time. 
- STRING Data
Data string to display on the LEDs 
- 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 
- VOID Return


Initialise

Initialise
Configures the I2C peripheral and sets up the HT16K33 IC ready to drive the LEDs. 
- VOID Return


SetBrightness

SetBrightness
Configures the brightness of the LEDs by varying the On portion of the duty. 
- BYTE Brightness
Range: 0-15 - 0 = Min Brightness, 15 = Full Brightness 
- VOID Return


ShiftColumns

ShiftColumns
Shifts the columns one place left or right. Used for things like displaying scrolling text. 
- BYTE Direction
0 = Shift Left, 1 = Shift Right 
- VOID Return


WriteColumn

WriteColumn
Allows a single column of 8 LEDs to be controlled in a single action. 
- BYTE Column
Range: 0-15 
- BYTE Data
Data to display on the column of LEDs 
- VOID Return


WriteCommand

WriteCommand
Writes a command. 
- BYTE Command
 
- VOID Return


WriteLED

WriteLED
Allows a single LED to be controlled using the basic column / row coordinate system. Each column is comprised of 8 rows. 
- BYTE Column
Range: 0-15 
- BYTE Row
Range: 0-7 
- BYTE Data
0 = LED Off, 1 = LED On 
- VOID Return


WriteLEDXY

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. 
- BYTE X
X coordinate. Range: 0-15 
- BYTE Y
Y coordinate. Range: 0-15 
- BYTE State
State 0=Off, 1=On 
- VOID Return


WriteRegister

WriteRegister
Writes a value to a register. 
- BYTE Address
 
- BYTE Value
 
- VOID Return


Property reference

Properties
Display Module
Selects the layout of the module you are controlling. Several modules are available in pre wired formats to provide an off the shelf LED matrix. 
LED Count
Total number of LEDs in the component 
Connections
Slave Address
Sets the software device slave address. Must be configured to match the wiring of the three hardware address pins. 
Channel
Channel selection 
Baud Select
Baud rate option selector 
Baud Rate
Baud rate to be used 
Stop Delay
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
Pin used for SDA (data signal) 
SCL
Pin used for SCL (clock signal) 
Colours
On Color
Simulated colour of the LEDs when switched On 
Off Color
Simulated colour of the LEDs when switched Off 
PCB Colour
 
Label Colour
 
Simulation
Simulation Type
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. 
GUI
Column Spacing
Simulation column spacing 
Width
Simulation LED width 
Row Spacing
Simulation row spacing 
Height
Simulated LED height 
Depth
Simulated LED Depth (3D environments only) 
LED Shape
Simulated LED basic shape  

Component Source Code

Please click here to download the component source project: FC_Comp_Source_LED_Matrix_HT16K33.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_LED_Matrix_HT16K33.fcfx