Skip to main content

Sugar - Digital Tube Module



Display conventional numbers, the two dots in the middle can serve as symbols of the clock: light up

Signal: Timing signal

Module Principle

A digital tube is a common display device often used for digital display in devices such as digital clocks, counters, and information prompts. The working principle of the digital tube is to convert the digital signal into a current signal, and control the direction and magnitude of the current flow to make the LED (light-emitting diode) emit light, thereby realizing the function of digital display.



Future board Lite interfaceCable
2数码管模块.pngSugar cube digital tube moduleI2CBlack PH2.0-4Pin interface cablePH2.0-4pin.png

warning Either I2C terminal can be connected to

Building Block - Function Description

Serial NumberBuilding Block ImageBuilding Block Function
1blocksPng-1710408493018Displays digital number (integer 0-9999)
2blocksPng-1710408496958Unit displays the content of the digital tube, digits 0-15, and digits greater than 10 will be converted to letters A-F
3blocksPng-1710408500517Displays "-" at the specified position
4blocksPng-1710408504109Controls the on/off of ":" for the digital tube module
6blocksPng-1710408518142Controls the brightness of the digital tube
7blocksPng-1710408521606Clears display, turns on display, turns off display for the digital tube

Program 1 - Full Program


Program 1 - Functional Description

: Initialize a whole number, reduce it by 1 every second, and display it.

Program 2 - Complete Program


Procedure 2- Functional Description

Clear the previous display when booting up and set two variables for the scores blocksPng-1710474368798

Control the scores of different teams by pressing buttons; each press adds 5


Display the scores; the digit in the unit's place is the remainder of the current value divided by 10, and the digit in the ten's place is the current value divided by 10


Using Kittenblock

Run the program offline to view the effect

Using on Microbit


Programming Platform

Microsoft MakeCode for micro:bit Use Makecode Programming Platform

Add Sugar Cube Plugin



In the extensions, search for Sugar, click Add

Circuit Connection


Microbit PortWiring
2数码管模块.pngSugar Cube Digital Tube ModuleI2CBlack PH2.0-4Pin Interface CablePH2.0-4pin.png

Building Block - Function Description

Serial NumberBuilding Block ImageBuilding Block Function
1image-20240315115239560Controls the opening of the digital tube
2image-20240315115249998Controls the closing of the digital tube
3image-20240315115304058Displays clear
4image-20240315115424502From left to right, the position is 0-3, and the hexadecimal data displayed is 0-9 and a-f
5image-20240315115403287Displays a decimal data
6image-20240315115411732Displays a hexadecimal data
7image-20240315115327771Turns on the decimal point position of the module

Case 1: Key Count - Decimal


Case 2: Key Count - Hexadecimal


Case 3: Scoreboard