Component: LED Matrix (HT16K33) (LEDs)

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

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

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

ClearLEDs

Fc9-comp-macro.png ClearLEDs
Sets all of the LEDs in the matrix to the off state. 
Fc9-void-icon.png - VOID Return


DisplayString

Fc9-comp-macro.png DisplayString
Prints an ASCII string onto the LED Matrix a column at a time. 
Fc9-string-icon.png - STRING Data
Data string to display on the LEDs 
Fc9-u16-icon.png - UINT Animation_Delay
Delay in milliseconds between writing to the next column 
Fc9-u8-icon.png - BYTE Leadout
Allows the text to scroll completely off the display before returning 0=No, 1=Yes 
Fc9-u8-icon.png - BYTE Add_Spaces
Add spaces between each ASCII character 0=No, 1=Yes 
Fc9-u8-icon.png - BYTE Orientation
0=Normal, 1=Rotated 90 Degrees 
Fc9-void-icon.png - VOID Return


Initialise

Fc9-comp-macro.png Initialise
Configures the I2C peripheral and sets up the HT16K33 IC ready to drive the LEDs. 
Fc9-void-icon.png - VOID Return


SetBrightness

Fc9-comp-macro.png SetBrightness
Configures the brightness of the LEDs by varying the On portion of the duty. 
Fc9-u8-icon.png - BYTE Brightness
Range: 0-15 - 0 = Min Brightness, 15 = Full Brightness 
Fc9-void-icon.png - VOID Return


ShiftColumns

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


WriteColumn

Fc9-comp-macro.png WriteColumn
Allows a single column of 8 LEDs to be controlled in a single action. 
Fc9-u8-icon.png - BYTE Column
Range: 0-15 
Fc9-u8-icon.png - BYTE Data
Data to display on the column of LEDs 
Fc9-void-icon.png - VOID Return


WriteCommand

Fc9-comp-macro.png WriteCommand
Writes a command. 
Fc9-u8-icon.png - BYTE Command
 
Fc9-void-icon.png - VOID Return


WriteLED

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


WriteLEDXY

Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE X
X coordinate. Range: 0-15 
Fc9-u8-icon.png - BYTE Y
Y coordinate. Range: 0-15 
Fc9-u8-icon.png - BYTE State
State 0=Off, 1=On 
Fc9-void-icon.png - VOID Return


WriteRegister

Fc9-comp-macro.png WriteRegister
Writes a value to a register. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Value
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png 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. 
Fc9-type-14-icon.png LED Count
Total number of LEDs in the component 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Slave Address
Sets the software device slave address. Must be configured to match the wiring of the three hardware address pins. 
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png 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.  
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-conn-icon.png Colours
Fc9-type-1-icon.png On Color
Simulated colour of the LEDs when switched On 
Fc9-type-1-icon.png Off Color
Simulated colour of the LEDs when switched Off 
Fc9-type-1-icon.png PCB Colour
 
Fc9-type-1-icon.png Label Colour
 
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png 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. 
Fc9-conn-icon.png GUI
Fc9-type-15-icon.png Column Spacing
Simulation column spacing 
Fc9-type-15-icon.png Width
Simulation LED width 
Fc9-type-15-icon.png Row Spacing
Simulation row spacing 
Fc9-type-15-icon.png Height
Simulated LED height 
Fc9-type-15-icon.png Depth
Simulated LED Depth (3D environments only) 
Fc9-type-16-icon.png LED Shape
Simulated LED basic shape