HT16K33 4-Digit 7-Segment Display
Overview
A 4-digit 7-segment display using the HT16K33 chipset. It uses I2C interface.

Specifications
- Onboard HT16K33 LED Controller
- I2C interface
- 1/16-step display dimming
- I2C address jumper selectable from 0x70 to 0x77
Supported GPIO
- Raspberry Pi 0~4
- Raspberry Pi 5
- BeagleBone Black/Green
- Jetson Nano
- FT232H, FT2232H, FT4232H
- MCP2221
Commands
[PRINT_TEXT]
Sets text on the display. Some characters may not be displayable. You must execute the WRITE_DISPLAY command after setting to show it on the display.
Item | Type | Description |
---|---|---|
Text | WRITE | Enter the text to set. |
[PRINT_NUM]
Sets numbers on the display. Negative numbers and decimal points are also supported. You must execute the WRITE_DISPLAY command after setting to show it on the display.
Item | Type | Description |
---|---|---|
Number | WRITE | Enter the number to set. |
Decimal Places | WRITE | Set how many decimal places to display. (0~3) |
[PRINT_DATE]
Sets date on the display in “Year.Month” or “Month.Day” format. You must execute the WRITE_DISPLAY command after setting to show it on the display.
Item | Type | Description |
---|---|---|
Date | WRITE | Enter the date to set. |
Display Content | WRITE | Select the content to display. (Year/Month, Month/Day) |
Show Dot (.) | WRITE | Set whether to display a dot (.) between Year/Month or Month/Day. |
[PRINT_CLOCK]
Sets time on the display in “Hour:Minute” or “Minute:Second” format. You must execute the WRITE_DISPLAY command after setting to show it on the display.
Item | Type | Description |
---|---|---|
Time | WRITE | Enter the time to set. |
Display Content | WRITE | Select the content to display. (Hour/Minute, Minute/Second) |
Show Colon (:) | WRITE | Set whether to display a colon (:) between Hour/Minute or Minute/Second. |
[PRINT_TIME]
Sets time duration on the display in “Hour:Minute” or “Minute:Second” format. If time exceeds 99 hours, it will be displayed as 99 hours. You must execute the WRITE_DISPLAY command after setting to show it on the display.
Item | Type | Description |
---|---|---|
Time Duration | WRITE | Enter the time duration to set. |
Display Content | WRITE | Select the content to display. (Hour/Minute, Minute/Second) |
Show Colon (:) | WRITE | Set whether to display a colon (:) between Hour/Minute or Minute/Second. |
[WRITE_DIGIT_NUM]
Sets a number at a specific position on the display. You must execute the WRITE_DISPLAY command after setting to show it on the display.
Item | Type | Description |
---|---|---|
Position (0~3) | WRITE | Set the position to display the number. (0 from leftmost) |
Number (0~9) | WRITE | Enter the number to display. (0~9) |
Show Dot (.) | WRITE | Set whether to display a dot (.) after the number. |
[WRITE_DIGIT_ASCII]
Sets a character corresponding to ASCII code at a specific position on the display. Some characters may not be displayable. You must execute the WRITE_DISPLAY command after setting to show it on the display.
Item | Type | Description |
---|---|---|
Position (0~3) | WRITE | Set the position to display the character. (0 from leftmost) |
ASCII Code | WRITE | Enter the character to display as ASCII code. |
Show Dot (.) | WRITE | Set whether to display a dot (.) after the character. |
[DRAW_COLON]
Sets whether to display the colon (:) on the display. You must execute the WRITE_DISPLAY command after setting to show it on the display.
Item | Type | Description |
---|---|---|
Show Colon (:) | WRITE | Set whether to display the colon (:). |
[WRITE_DIGIT_RAW]
Sets a byte value configured as bitmask at a specific position on the display. You must execute the WRITE_DISPLAY command after setting to show it on the display.
Item | Type | Description |
---|---|---|
Position (0~4) | WRITE | Set the position to display the bitmask value. Includes the colon (:) position. (0 from leftmost) |
BITMASK * | WRITE | Enter the bitmask value to display at that position. |
To display colon (:), enter 0x02 (decimal 2); to not display, enter 0x00 (decimal 0).

[WRITE_DISPLAY]
Actually displays the configured content on the display.
[CLEAR]
Clears all configured content. You must execute the WRITE_DISPLAY command after setting to reflect it on the display.
[SET_BRIGHTNESS]
Sets the brightness of the display.
Item | Type | Description |
---|---|---|
Brightness | WRITE | Set the brightness of the display. (0~15) |
[BLINK_RATE]
Sets the blink rate of the display.
Item | Type | Description |
---|---|---|
Blink Rate | WRITE | Set the display blink rate. (None, Twice per second, Once per second, Once every 2 seconds) |
Example
Objective
Display the current time on the display in “Hour:Minute” format with the colon (:) blinking once per second.
Parts
Part | Quantity |
---|---|
Raspberry Pi 4 * | 1 |
HT16K33 Display | 1 |
Wiring
Connect the following pins horizontally to each other.
HT16K33 Display | GPIO |
---|---|
VIN | 3.3V |
GND | GND |
SCL (C) | 3 (I2C1 SCL) |
SDA (D) | 2 (I2C1 SDA) |

Project Link