LED Dot Matrix Gray Scale Display Control Method
By converting the dot matrix content into an array and performing brightness normalization processing, combined with timer control, the grayscale display of the LED matrix is realized, solving the problem that the monochrome LED matrix cannot display different brightnesses, and achieving a flexible and low-cost grayscale display effect.
Patent Information
- Application Number
- CN202211020600.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-08-24
AI Technical Summary
Existing monochrome LED matrices cannot display dot matrix contents containing different brightness without increasing hardware costs.
By converting the dot matrix content into an array, normalizing the brightness information, setting the timer unit and controlling the lighting and extinguishing of the LED in the timer interrupt, the grayscale display is achieved using the human eye visual residence effect.
Without changing the hardware, the grayscale display of the LED matrix is realized, with high flexibility and low cost, and can display dynamic or static information with grayscale.
Smart Images

Figure CN115294921B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of LED dot matrix displays, and particularly to a method for controlling the gray-scale display of an LED dot matrix. Background Art
[0002] An LED matrix is a hardware module made based on LED devices, mainly used for displaying static or dynamic content. The LED beads used for matrix applications can be monochromatic or colored. Large LED matrices are commonly used for outdoor displays, small LED matrices are used for indoor displays, and micro LED matrices are commonly found in various consumer electronics products. The hardware design of the LED matrix is simple and easy to cut, while its control logic is relatively complex.
[0003] In most existing monochromatic LED matrices, in most applications, only dot matrix content with a fixed brightness can be displayed - each LED has only two states: on or off (as Figure 1 shown), and it is impossible to display dot matrix content with different brightnesses (or gray scales) without increasing the hardware cost. Summary of the Invention
[0004] The present invention provides a method for controlling the gray-scale display of an LED dot matrix to solve at least one of the above technical problems.
[0005] To solve the above problems, as one aspect of the present invention, a method for controlling the gray-scale display of an LED dot matrix is provided, including:
[0006] Step 1, converting the dot matrix content to be displayed into an array, where the array contains the position and brightness information of the corresponding dot matrix LEDs;
[0007] Step 2, normalizing the brightness information of each point in the dot matrix content to convert it into a multiple of the lighting time corresponding to the lowest brightness, so that the brightness information contained in each element in the array is converted into an integer;
[0008] Step 3, setting a timer unit according to the shortest lighting time corresponding to the lowest brightness and setting a timing interrupt;
[0009] Step 4, in the timer interrupt, determine whether to continue lighting or extinguish at each occurrence of the timer interrupt according to a certain dot matrix element in the array. When the number of timer interrupts exceeds the maximum brightness multiple, then process the next dot matrix element in the array, and so on in a loop until all elements in the dot matrix are processed.
[0010] Preferably, the array is a one-dimensional or multi-dimensional array.
[0011] Preferably, the position of the corresponding dot matrix LED is reflected by the position of the element in the array, and the brightness information is reflected by the value of the array element.
[0012] Preferably, the brightness information of each point in the dot matrix content is normalized and converted into a multiple of the lighting time corresponding to the lowest brightness through the following formula:
[0013] t on(n) = k·n·t on(0)
[0014] where n = 1, 2, 3..., is the brightness level represented by an integer, and the coefficient k is an empirical coefficient.
[0015] Preferably, the coefficient k is generally a decimal number, related to the lowest brightness that can be observed by the human eye, or adjusted according to the display effect.
[0016] Due to the above technical solution, the present invention can, based on the human eye's persistence of vision effect, implement static or dynamic dot matrix content containing brightness change information through software without changing the traditional LED matrix hardware. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 Schematically shows a schematic diagram of fixed brightness display in the prior art;
[0018] Figure 2 Schematically shows a schematic diagram of the present invention with grayscale (different brightness) display;
[0019] Figure 3 Schematically shows the dot matrix array after normalization processing;
[0020] Figure 4 Schematically shows the lighting and blanking control of dot matrix elements at different brightness levels. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] The following describes the embodiments of the present invention in detail, but the present invention can be implemented in many different ways defined and covered by the claims.
[0022] As an aspect of the present invention, there is provided an LED dot matrix grayscale display control method, which is applied to electronic products using an LED matrix as a status indication device, for example, applied to charging devices - including products such as chargers and mobile power supplies, and includes:
[0023] Step 1, convert the dot matrix content to be displayed into an array, and the array contains the position and brightness information of the corresponding dot matrix LEDs;
[0024] Step 2, normalize the brightness information of each point in the dot matrix content to convert it into a multiple of the lighting time corresponding to the lowest brightness, so that the brightness information contained in each element in the array is converted into an integer;
[0025] Step 3: Set the timer unit according to the shortest lighting time corresponding to the lowest brightness, and set up the timer interrupt.
[0026] Step 4: In the timer interrupt, determine whether to continue lighting or extinguish at each timer interrupt according to a certain dot matrix element in the array. When the number of timer interrupts exceeds the maximum brightness multiple, then process the next dot matrix element in the array, and so on in a loop until all elements in the dot matrix are processed.
[0027] Preferably, the array is a one-dimensional or multi-dimensional array.
[0028] Preferably, the position of the corresponding dot matrix LED is reflected by the position of the element in the array, and the brightness information is reflected by the array element value.
[0029] Preferably, normalize the brightness information of each point in the dot matrix content to convert it into a multiple of the lighting time corresponding to the lowest brightness through the following formula:
[0030] t on(n) = k·n·t on(0)
[0031] where n = 1, 2, 3…, is the brightness level represented by an integer, and the coefficient k is an empirical coefficient.
[0032] Preferably, the coefficient k is generally a decimal, related to the lowest brightness that can be observed by the human eye, or adjusted according to the display effect.
[0033] Next, the implementation process and principle of the present invention will be described in detail.
[0034] To implement the dot matrix content with variable brightness as Figure 2 shown, it is necessary to determine the maximum number of points contained in the dot matrix content, such as 81. Assuming the human eye's visual persistence time is 0.03 seconds. Then for the Charlie multiplexed LED matrix, the longest lighting time (t on ) of each LED is 370 μS (t on(max) ), and the different lighting durations of the LED result in different brightnesses observed by the human eye, and the switching speed of a single LED is in the nanosecond range.
[0035] Utilizing this feature and the actual brightness range contained in the dot matrix content, the brightness can be divided into multiple levels - different brightness levels (g lvl)Corresponding to the duration of LED lighting, in other words, for points with high brightness, the lighting time is long; for points with low brightness, the lighting time is short. Under normal circumstances, most people can observe that the shortest lighting time of the LED is about 200ns. Considering the execution time of the microcontroller instructions, the theoretical lighting time of each LED with different brightness needs to subtract the execution time of the instructions for operating the LED (such as lighting, extinguishing, or breaking the circuit).
[0036] To achieve the dot matrix content with brightness changes as Figure 2 shown, the following steps can be taken:
[0037] 1. Pre-convert the dot matrix content into a one-dimensional or multi-dimensional array (the array contains information such as the position of the corresponding dot matrix LED (represented by the position of the elements in the array), brightness (the value of the array elements), etc.);
[0038] 2. Normalize the brightness information of each point (each element in the array) in the dot matrix content to convert it into a multiple of the lighting time corresponding to the lowest brightness: t on(n) = k·n·t on(0) , where n = 1, 2, 3…, is the brightness level represented by an integer, and the coefficient k is an empirical coefficient (generally a decimal, related to the lowest brightness that can be observed by the human eye in actual applications, or adjusted according to the display effect); finally, convert the brightness information contained in each element of the array into an integer n (as Figure 3 shown);
[0039] 3. Set the timer unit according to the adjusted shortest lighting time (k·t lvl ) corresponding to the lowest brightness (g on(0) ), and set up the timer interrupt;
[0040] 4. In the timer interrupt, process the array elements containing the dot matrix content in step 1 one by one, and decide whether to continue lighting or extinguishing when each timer interrupt occurs according to the normalized brightness multiple n. When the number of timer interrupts exceeds the maximum brightness multiple n, then process the next dot matrix element in the array, and so on in a loop until all elements in the dot matrix are processed.
[0041] If you want to display continuously changing dot matrix content containing different brightness information, repeat the above 4 steps. Assuming the total number of LEDs to be displayed is m, the time interval between two consecutive dot matrix contents (or called frames) is t frame = t on(max) ·m. The setting of the frame rate will affect the empirical coefficient k. The higher the frame rate, the smaller the coefficient k, and the lower the brightness visible to the human eye.
[0042] Due to the adoption of the above technical solution, the present invention can design an LED matrix based on a conventional ordinary patch LED (for example, design an LED matrix in the Charlie multiplexing mode, a row-scanning LED matrix, etc.), with flexible design and low cost. It can design corresponding display control software based on the human eye's persistence of vision effect, can display dynamic information or static information with grayscale, and can further indicate different status information required to be displayed by the charging device. It can also scroll (horizontally or vertically) through the display control software to display complex information.
[0043] Due to the adoption of the above technical solution, based on the human eye's persistence of vision effect, the present invention can, without changing the traditional LED matrix hardware, implement static or dynamic dot matrix content containing brightness change information through software.
[0044] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An LED dot matrix grayscale display control method, characterized in that Including: Step 1: Convert the dot-matrix content to be displayed into an array, where the array contains the position and brightness information of the corresponding dot-matrix LEDs; Step 2, normalize the brightness information of each point in the dot matrix content by the following formula to convert it into a multiple of the lighting time corresponding to the lowest brightness, so that the brightness information contained in each element in the array is converted into an integer: t on(n) = k·n·t on(0) , where n = 1, 2, 3..., is the brightness level represented by an integer, and the coefficient k is an empirical coefficient; Step 3: Set the timer unit according to the shortest lighting time corresponding to the lowest brightness, and set up the timer interrupt; Step 4: In the timer interrupt, determine whether to continue lighting or extinguish at each occurrence of the timer interrupt according to a certain dot-matrix element in the array. When the number of timer interrupts exceeds the maximum brightness multiple, then process the next dot-matrix element in the array, and so on in a loop until all elements in the dot matrix are processed; Among them, the points with high brightness have a long lighting time; the points with low brightness have a short lighting time. The theoretical lighting time of each LED with different brightnesses also needs to subtract the execution time of the instructions for operating the lighting and extinguishing of the LEDs.
2. The LED dot matrix grayscale display control method according to claim 1, wherein The array is a one-dimensional or multi-dimensional array.
3. The LED dot matrix grayscale display control method according to claim 1, wherein The position of the corresponding dot-matrix LED is reflected by the position of the element in the array, and the brightness information is reflected by the value of the array element.
4. The LED dot matrix grayscale display control method according to claim 1, characterized in that The coefficient k is generally a decimal, which is related to the lowest brightness that can be observed by the human eye, or can be adjusted according to the display effect.
Citation Information
Patent Citations
Gray level modulation method and LED array-based image display system
CN107749272A
Dimming method, device and equipment of display panel and computer readable storage medium
CN114822394A