Dynamic LED matrix display method and system based on accelerometer data
By collecting accelerometer data in real time and updating the LED matrix display content, the problem of lack of interactivity in the traditional LED matrix display system is solved, and rich and real dynamic visual effects are achieved.
Patent Information
- Application Number
- CN202411515756.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-14
AI Technical Summary
The traditional LED matrix display system lacks interaction with the user's actual motion state, and cannot adjust the display content in real time according to the user's actions and environmental changes, providing a rich and realistic visual experience.
By collecting accelerometer data in real time, the motion trajectory of each pixel on the LED matrix is calculated, and the display content of the LED matrix is updated in real time based on these data to achieve dynamic visual effects.
It realizes dynamic visual effects based on physical acceleration data, enhances the interactiveness and dynamic response capabilities of the display system, and provides a richer and more realistic visual experience.
Smart Images

Figure CN119450022A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of dynamic display technology, and in particular to a method and system for controlling LED matrix display by using accelerometer data, which is used to achieve dynamic visual effects based on physical acceleration data. Background Art
[0002] In the field of dynamic display technology, LED matrix display systems are widely used due to their advantages such as high brightness, low power consumption, long life and fast response time. However, most traditional LED matrix display systems can only display static images or simple dynamic effects, lacking the interactivity combined with the user's actual motion state. With the development of intelligent control technology, users have put forward higher requirements for the interactivity and dynamic response capabilities of display devices. Especially in the fields of virtual reality, augmented reality and wearable devices, a display system is required to be able to adjust the display content in real time according to its movements and environmental changes, providing a richer and more realistic visual experience.
[0003] As a sensor that can measure acceleration, accelerometers are widely used in consumer electronics, automotive electronics, aerospace and other fields. Accelerometer data can be used to obtain the motion state of an object, including information such as tilt and vibration. However, existing technologies rarely use accelerometer data to control LED matrix displays to achieve dynamic visual effects based on physical motion data. Summary of the invention
[0004] In order to solve the above problems, the purpose of the present invention is to provide a dynamic LED matrix display method and system based on accelerometer data, which can update the display content of the LED matrix in real time according to the accelerometer data to achieve richer and more realistic dynamic visual effects.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] The data of the accelerometer sensor is collected in real time and converted into digital signal output.
[0007] The collected acceleration data is processed to calculate the motion trajectory of each pixel on the LED matrix.
[0008] According to the output of the data processing module, the position and color of each pixel on the LED matrix are controlled to achieve a dynamic display effect.
[0009] Add glow effects on the LED matrix to enhance the visual effect.
[0010] Integrate the above modules into a complete system to realize the whole process control from acceleration data reading to LED matrix display.
[0011] A dynamic LED matrix display method and system based on accelerometer data, characterized in that it includes the following steps:
[0012] Initialize the pixel matrix parameters to set the initial conditions for all pixels. This includes defining parameters such as the size, brightness, and pixel size of the LED matrix, as well as randomly assigning friction, bounce coefficient, and color to each pixel.
[0013] Initialize the accelerometer and gyroscope and set the offset of the accelerometer and gyroscope. This step ensures accurate readings of the sensor and provides a basis for subsequent data processing.
[0014] Periodically read the accelerometer and gyroscope data to obtain the current acceleration and angular velocity information.
[0015] Based on the accelerometer data read, the acceleration of each pixel on the X and Y axes is calculated and taken into account together with gravity and friction to simulate movement in the physical world.
[0016] According to the calculated acceleration, the speed and position of each pixel are updated to simulate the movement of the pixel on the LED matrix.
[0017] Determine whether the pixel touches the border of the LED matrix. If it touches the border, adjust its position according to the bounce coefficient and update its speed to simulate the bounce effect in reality.
[0018] According to the position and color information of each pixel, pixel points are drawn on the LED matrix, and luminous effects are added to enhance the visual effect.
[0019] Check whether the minimum integral step is reached to determine whether the next data processing is needed. This is to control the update frequency and ensure the smooth operation of the system.
[0020] If the system continues to run, steps S103 to S108 are executed in a loop to achieve a dynamic LED matrix display effect.
[0021] Furthermore, a dynamic LED matrix display method and system based on accelerometer data is characterized in that initializing pixel matrix parameters and setting initial conditions for all pixels specifically includes:
[0022] Define parameters such as the size, brightness and pixel size of the LED matrix, as well as randomly assign friction, bounce coefficient and color to each pixel.
[0023] Set the dimensions of the LED matrix, including the number of LEDs horizontally (MATR_X) and vertically (MATR_Y). Set the brightness parameter (BRIGHTNESS) to define the light intensity of the entire LED matrix. The brightness range is 0 to 255, where 0 is completely off and 255 is maximum brightness. Define the physical size of each pixel (PIXELSIZE) to calculate the position of the pixel in real space.
[0024] Each pixel is assigned a friction value (friction) to simulate the friction effect in physical motion. Each pixel is assigned a bounce coefficient (bounce), which determines how hard the pixel bounces after a collision. Each pixel is randomly selected with a color (color) and mapped by the value in the color array (colors).
[0025] Furthermore, a dynamic LED matrix display method and system based on accelerometer data is characterized by initializing the accelerometer and gyroscope and setting the offset of the accelerometer and gyroscope. Specifically including:
[0026] Wake up the accelerometer and gyroscope from their initial sleep mode, configure the sampling rate and digital filter of the accelerometer and gyroscope, and set the measurement range of the accelerometer and gyroscope.
[0027] The range of the accelerometer may include, but is not limited to, ±2g, ±4g, ±8g, or ±16g, and the range of the gyroscope may include, but is not limited to, ±125° / s, ±250° / s, ±500° / s, ±1000° / s, or ±2000° / s.
[0028] The offset values of the accelerometer and gyroscope are programmed based on the offset values obtained in the previous calibration, and the offset values are used to compensate for the non-zero output of the sensor in a stationary state.
[0029] Furthermore, a dynamic LED matrix display method and system based on accelerometer data is characterized in that the accelerometer and gyroscope data are periodically read to obtain the current acceleration and angular velocity information, specifically including:
[0030] The microcontroller processing unit is used to periodically send read commands to the accelerometer and gyroscope through the I2C or SPI communication interface. According to the read commands sent, the accelerometer and gyroscope return the current acceleration value data of the three axes (X, Y, Z axis) and the angular velocity value data of the three axes (X, Y, Z axis).
[0031] The read data is stored in the memory of the microcontroller, and the read raw data is filtered to eliminate noise and interference. The present invention can use, including but not limited to, a low-pass filter, a Kalman filter or other suitable filtering algorithms.
[0032] After each periodic reading, the stored acceleration and angular velocity data are updated to reflect the latest motion status. The processed data is output to the LED matrix control unit for real-time adjustment of the display effect of the LED matrix.
[0033] Furthermore, a dynamic LED matrix display method and system based on accelerometer data is characterized in that the speed and position of each pixel are updated according to the calculated acceleration to simulate the movement of the pixel on the LED matrix, specifically including:
[0034] The accelerometer sensor reads the acceleration value of the device in the three axes of X, Y, and Z in real time. When calculating the acceleration of each pixel, the influence of gravity (G_CONST) and friction (FRICTION) is considered. The gravity acceleration value is set according to the local gravity acceleration, and the friction is calculated according to the friction coefficient of each pixel.
[0035] For each pixel, calculate its acceleration on the X and Y axes based on the data read by the accelerometer. The specific calculation formula is as follows:
[0036] ax=32768Range×G×ACCx(X-axis acceleration)
[0037] ay=32768Range×G×ACCy(Y-axis acceleration)
[0038] Among them, ACCx and ACCy are the raw data of the accelerometer on the X-axis and Y-axis respectively, Range is determined by the parameters written when configuring the accelerometer range, and G is the local gravity acceleration
[0039] When calculating acceleration, the influence of friction is taken into account and the friction effect is simulated by adjusting the acceleration value. The calculation formula for friction is as follows:
[0040] frictx=G×(1-mpuPitch)×friction[i]×10(X-axis friction)
[0041] fricty=G×(1-mpuRoll)×friction[i]×10(Y-axis friction)
[0042] Among them, mpuPitch and mpuRoll are the Pitch and Roll values of the accelerometer and gyroscope respectively, and friction[i] is the friction coefficient of the i-th pixel.
[0043] According to the calculated acceleration, the speed and position of each pixel are updated to simulate the motion effect in the physical world.
[0044] Furthermore, a dynamic LED matrix display method and system based on accelerometer data is characterized in that the speed and position of each pixel are updated according to the calculated acceleration to simulate the movement of the pixel on the LED matrix, specifically including:
[0045] The acceleration values of each pixel point on the X and Y axes calculated in step S104 are received.
[0046] Speed update: Update the speed of each pixel according to Newton's second law of motion, that is, force equals mass multiplied by acceleration (F=ma). In this system, the mass of the pixel is unit mass, and the acceleration is directly equivalent to the rate of change of speed. The speed update formula is as follows:
[0047] vx[i]=vx[i]+ax[i]·Δt (X-axis speed update)
[0048] vy[i]=vy[i]+ay[i]·Δt (Y-axis velocity update) where vx[i] and vy[i] are the velocities of the i-th pixel on the X-axis and Y-axis respectively, ax[i] and ay[i] are the corresponding accelerations, and Δt is the time step.
[0049] According to the updated speed, calculate the new position of each pixel. The position update formula is as follows:
[0050] xdist[i]=xdist[i]+vx[i]·Δt (X-axis position update)
[0051] ydist[i]=ydist[i]+vy[i]·Δt (Y-axis position update)
[0052] Among them, xdist[i] and ydist[i] are the positions of the i-th pixel on the X-axis and Y-axis respectively.
[0053] When updating the position, check if the pixel is outside the boundaries of the LED matrix. If so, handle the boundary condition according to the rules of physics (reflect or stop).
[0054] The updated speed and position data are recorded in the corresponding arrays and memory locations for subsequent display updates.
[0055] Furthermore, a dynamic LED matrix display method and system based on accelerometer data is characterized in that it is determined whether a pixel point touches the boundary of the LED matrix. If it touches the boundary, its position is adjusted according to the rebound coefficient, and its speed is updated to simulate the rebound effect in reality. Specifically, it includes:
[0056] The X and Y coordinates of the pixel points are checked for boundary conditions. For each pixel point, its current position on the LED matrix is calculated to determine whether the pixel point touches the boundary of the matrix.
[0057] When it is detected that a pixel has touched the boundary, the position of the pixel is adjusted according to the preset rebound coefficient so that it bounces back into the matrix. The rebound coefficient determines the speed and direction of the pixel after it bounces.
[0058] It involves adjusting the velocity vector of the pixel point to reflect the motion state after the rebound. After the pixel point rebounds, its velocity is updated according to the rebound coefficient.
[0059] According to the speed and rebound point after rebound, the new position of the pixel is calculated and the pixel is lit within the display range of the LED matrix.
[0060] Furthermore, a dynamic LED matrix display method and system based on accelerometer data is characterized in that, according to the position and color information of each pixel, pixels are drawn on the LED matrix, and a lighting effect is added to enhance the visual effect. Specifically, it includes:
[0061] According to the pixel position data updated in step S106, the exact position of each pixel on the LED matrix is determined.
[0062] Each pixel is assigned a preset or calculated color value, which can be static or dynamically generated according to a specific algorithm.
[0063] Using the LED matrix control interface, the color value of each pixel is written into the corresponding hardware register, so that each pixel is drawn on the LED matrix.
[0064] Adds an edge glow effect to each pixel, simulating a glowing edge by reducing the brightness of adjacent pixels.
[0065] Creates a halo effect around pixels, simulating a halo spread by gradually decreasing the brightness of surrounding pixels.
[0066] A color gradient effect is achieved around pixels, simulating a natural transition of colors by changing the color values of surrounding pixels.
[0067] After all pixels are drawn and the luminous effect is enhanced, the data buffer of the LED matrix is refreshed and the updated data is written to the LED matrix to achieve a dynamic display effect.
[0068] Furthermore, a dynamic LED matrix display method and system based on accelerometer data is characterized by checking whether the minimum integral step is reached to determine whether the next data processing is required. Specifically including:
[0069] The time interval between two data processings is measured and compared with the preset minimum integration step size.
[0070] When the time interval measured by the time control unit reaches or exceeds the preset minimum integration step, the next data processing is triggered.
[0071] According to the performance and display requirements of the system, a minimum integration step value is preset, which determines the minimum time interval for data processing. After each data processing, the time control unit measures the time elapsed since the last data processing. The measured time interval is compared with the preset minimum integration step. If the measured time interval reaches or exceeds the preset minimum integration step, the next data processing is triggered; otherwise, continue to wait until the minimum integration step is reached.
[0072] Furthermore, a dynamic LED matrix display method and system based on accelerometer data is characterized in that if the system continues to run, steps S103 to S108 are executed cyclically to achieve a dynamic LED matrix display effect. Specifically, it includes:
[0073] Manage the entire loop execution process to ensure that steps S103 to S108 are executed continuously and cyclically.
[0074] According to step S103 , the cyclic control unit periodically reads data from the accelerometer and the gyroscope.
[0075] According to steps S104 to S108, the loop control unit continuously calculates acceleration, updates pixel status, processes boundary collision, and draws pixel points.
[0076] The loop control unit ensures that the LED matrix display content is updated in real time according to the latest data processing results.
[0077] According to the embodiments of the present invention, preferably, the present invention adopts the above technical solution and has the following technical effects compared with the prior art: BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, drawings of other embodiments can be obtained based on these drawings without creative work. In the drawings:
[0079] Figure 1 A flowchart of a method according to a first embodiment of the present invention is shown; DETAILED DESCRIPTION
[0080] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further described below in conjunction with specific implementation methods. The following will describe the implementation methods of the present invention in detail in conjunction with the accompanying drawings and embodiments, so that the implementation process of how the present invention applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that as long as there is no conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other, and the technical solutions formed are all within the protection scope of the present invention.
[0081] Flow chart of the method of embodiment 1:
[0082] In order to solve the above technical problems existing in the prior art, an embodiment of the present invention provides a dynamic LED matrix display method and system based on accelerometer data.
[0083] Step S101: Initialize the pixel matrix parameters and set the initial conditions for all pixels, including defining the size, brightness and pixel size of the LED matrix, and randomly assigning friction, rebound coefficient and color to each pixel.
[0084] Step S102: Initialize the accelerometer and the gyroscope, and set the offset of the accelerometer and the gyroscope.
[0085] Step S103: periodically read the accelerometer and gyroscope data to obtain current acceleration and angular velocity information.
[0086] Step S104: Based on the read accelerometer data, the acceleration of each pixel on the X and Y axes is calculated and considered together with gravity and friction to simulate movement in the physical world.
[0087] Step S105: updating the speed and position of each pixel according to the calculated acceleration, simulating the movement of the pixel on the LED matrix.
[0088] Step S106: Determine whether the pixel touches the border of the LED matrix. If it touches the border, adjust its position according to the rebound coefficient and update its speed to simulate the rebound effect in reality.
[0089] Step S107: Draw pixel points on the LED matrix according to the position and color information of each pixel, and add a lighting effect to enhance the visual effect.
[0090] Step S108: Check whether the minimum integration step length is reached to determine whether the next data processing is required.
[0091] Step S109: If the system continues to run, loop through steps S103 to S108 to achieve a dynamic LED matrix display effect.
[0092] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A dynamic LED matrix display method and system based on accelerometer data, characterized in that: The following steps are involved: Step S101: Initialize the pixel matrix parameters and set the initial conditions for all pixels. This includes defining parameters such as the size, brightness and pixel size of the LED matrix, as well as randomly assigning friction, rebound coefficient and color to each pixel. Step S102: Initialize the accelerometer and gyroscope, and set the offset of the accelerometer and gyroscope. This step ensures accurate readings of the sensor and provides a basis for subsequent data processing. Step S103: periodically read the accelerometer and gyroscope data to obtain current acceleration and angular velocity information. Step S104: Based on the read accelerometer data, the acceleration of each pixel on the X and Y axes is calculated and considered together with gravity and friction to simulate movement in the physical world. Step S105: updating the speed and position of each pixel according to the calculated acceleration, simulating the movement of the pixel on the LED matrix. Step S106: Determine whether the pixel touches the border of the LED matrix. If it touches the border, adjust its position according to the rebound coefficient and update its speed to simulate the rebound effect in reality. Step S107: Draw pixel points on the LED matrix according to the position and color information of each pixel, and add a lighting effect to enhance the visual effect. Step S108: Check whether the minimum integral step length is reached to determine whether the next data processing is required. This is to control the update frequency and ensure the smooth operation of the system. Step S109: If the system continues to run, steps S103 to S108 are executed in a loop to achieve a dynamic LED matrix display effect.
2. A dynamic LED matrix display method and system based on accelerometer data according to claim 1, characterized in that: Initialize the pixel matrix parameters and set the initial conditions for all pixels, including: Define parameters such as the size, brightness and pixel size of the LED matrix, as well as randomly assign friction, bounce coefficient and color to each pixel. Set the dimensions of the LED matrix, including the number of LEDs horizontally (MATR_X) and vertically (MATR_Y). Set the brightness parameter (BRIGHTNESS) to define the light intensity of the entire LED matrix. The brightness range is 0 to 255, where 0 is completely off and 255 is maximum brightness. Define the physical size of each pixel (PIXELSIZE) to calculate the position of the pixel in real space. Each pixel is assigned a friction value (friction) to simulate the friction effect in physical motion. Each pixel is assigned a bounce coefficient (bounce), which determines how hard the pixel bounces after a collision. Each pixel is randomly selected with a color (color) and mapped by the value in the color array (colors).
3. A dynamic LED matrix display method and system based on accelerometer data according to claim 1, characterized in that: Initialize the accelerometer and gyroscope, and set the offset of the accelerometer and gyroscope. Specifically include: Wake up the accelerometer and gyroscope from their initial sleep mode, configure the sampling rate and digital filter of the accelerometer and gyroscope, and set the measurement range of the accelerometer and gyroscope. The range of the accelerometer may include, but is not limited to, ±2g, ±4g, ±8g, or ±16g, and the range of the gyroscope may include, but is not limited to, ±125° / s, ±250° / s, ±500° / s, ±1000° / s, or ±2000° / s. The offset values of the accelerometer and gyroscope are programmed based on the offset values obtained in the previous calibration, and the offset values are used to compensate for the non-zero output of the sensor in a stationary state.
4. A dynamic LED matrix display method and system based on accelerometer data according to claim 1, characterized in that: Periodically read the accelerometer and gyroscope data to obtain the current acceleration and angular velocity information, including: The microcontroller processing unit is used to periodically send read commands to the accelerometer and gyroscope through the I2C or SPI communication interface. According to the read commands sent, the accelerometer and gyroscope return the current acceleration value data of the three axes (X, Y, Z axis) and the angular velocity value data of the three axes (X, Y, Z axis). The read data is stored in the memory of the microcontroller, and the read raw data is filtered to eliminate noise and interference. The present invention can use, including but not limited to, a low-pass filter, a Kalman filter or other suitable filtering algorithms. After each periodic reading, the stored acceleration and angular velocity data are updated to reflect the latest motion status. The processed data is output to the LED matrix control unit for real-time adjustment of the display effect of the LED matrix.
5. A dynamic LED matrix display method and system based on accelerometer data according to claim 1, characterized in that: According to the calculated acceleration, the speed and position of each pixel are updated to simulate the movement of the pixel on the LED matrix, including: The accelerometer sensor reads the acceleration value of the device in the three axes of X, Y, and Z in real time. When calculating the acceleration of each pixel, the influence of gravity (G_CONST) and friction (FRICTION) is considered. The gravity acceleration value is set according to the local gravity acceleration, and the friction is calculated according to the friction coefficient of each pixel. For each pixel, calculate its acceleration on the X and Y axes based on the data read by the accelerometer. The specific calculation formula is as follows: ax=32768Range×G×ACCx(X-axis acceleration) ay=32768Range×G×ACCy(Y-axis acceleration) Among them, ACCx and ACCy are the raw data of the accelerometer on the X-axis and Y-axis respectively, Range is determined by the parameters written when configuring the accelerometer range, and G is the local gravity acceleration When calculating acceleration, the influence of friction is taken into account and the friction effect is simulated by adjusting the acceleration value. The calculation formula for friction is as follows: frictx=G×(1-mpuPitch)×friction[i]×10(X-axis friction) fricty=G×(1-mpuRoll)×friction[i]×10(Y-axis friction) Among them, mpuPitch and mpuRoll are the Pitch and Roll values of the accelerometer and gyroscope respectively, and friction[i] is the friction coefficient of the i-th pixel. According to the calculated acceleration, the speed and position of each pixel are updated to simulate the motion effect in the physical world.
6. A dynamic LED matrix display method and system based on accelerometer data according to claim 1, characterized in that: According to the calculated acceleration, the speed and position of each pixel are updated to simulate the movement of the pixel on the LED matrix, including: The acceleration values of each pixel point on the X and Y axes calculated in step S104 are received. Speed update: Update the speed of each pixel according to Newton's second law of motion, that is, force equals mass multiplied by acceleration (F=ma). In this system, the mass of the pixel is unit mass, and the acceleration is directly equivalent to the rate of change of speed. The speed update formula is as follows: vx[i]=vx[i]+ax[i]Δt (X-axis speed update) vy[i]=vy[i]+ay[i]Δt (Y-axis velocity update) where vx[i] and vy[i] are the velocities of the i-th pixel on the X-axis and Y-axis respectively, ax[i] and ay[i] are the corresponding accelerations, and Δt is the time step. According to the updated speed, calculate the new position of each pixel. The position update formula is as follows: xdist[i]=xdist[i]+vx[i]·Δt (X-axis position update) ydist[i]=ydist[i]+vy[i]·Δt (Y-axis position update) Among them, xdist[i] and ydist[i] are the positions of the i-th pixel on the X-axis and Y-axis respectively. When updating the position, check if the pixel is outside the boundaries of the LED matrix. If so, handle the boundary condition according to the rules of physics (reflect or stop). The updated speed and position data are recorded in the corresponding arrays and memory locations for subsequent display updates.
7. A dynamic LED matrix display method and system based on accelerometer data according to claim 1, characterized in that: Determine whether the pixel touches the border of the LED matrix. If it touches the border, adjust its position according to the rebound coefficient and update its speed to simulate the rebound effect in reality. Specifically include: The X and Y coordinates of the pixel points are checked for boundary conditions. For each pixel point, its current position on the LED matrix is calculated to determine whether the pixel point touches the boundary of the matrix. When it is detected that a pixel has touched the boundary, the position of the pixel is adjusted according to the preset rebound coefficient so that it bounces back into the matrix. The rebound coefficient determines the speed and direction of the pixel after it bounces. It involves adjusting the velocity vector of the pixel point to reflect the motion state after the rebound. After the pixel point rebounds, its velocity is updated according to the rebound coefficient. According to the speed and rebound point after rebound, the new position of the pixel is calculated and the pixel is lit within the display range of the LED matrix.
8. A dynamic LED matrix display method and system based on accelerometer data according to claim 1, characterized in that: According to the position and color information of each pixel, the pixel points are drawn on the LED matrix, and the luminous effect is added to enhance the visual effect. Specifically including: According to the pixel position data updated in step S106, the exact position of each pixel on the LED matrix is determined. Each pixel is assigned a preset or calculated color value, which can be static or dynamically generated according to a specific algorithm. Using the LED matrix control interface, the color value of each pixel is written into the corresponding hardware register, so that each pixel is drawn on the LED matrix. Adds an edge glow effect to each pixel, simulating a glowing edge by reducing the brightness of adjacent pixels. Creates a halo effect around pixels, simulating a halo spread by gradually decreasing the brightness of surrounding pixels. A color gradient effect is achieved around pixels, simulating a natural transition of colors by changing the color values of surrounding pixels. After all pixels are drawn and the luminous effect is enhanced, the data buffer of the LED matrix is refreshed and the updated data is written to the LED matrix to achieve a dynamic display effect.
9. A dynamic LED matrix display method and system based on accelerometer data according to claim 1, characterized in that: Check whether the minimum integral step length is reached to determine whether the next data processing is required. Specifically include: The time interval between two data processings is measured and compared with the preset minimum integration step size. When the time interval measured by the time control unit reaches or exceeds the preset minimum integration step, the next data processing is triggered. According to the performance and display requirements of the system, a minimum integration step value is preset, which determines the minimum time interval for data processing. After each data processing, the time control unit measures the time elapsed since the last data processing. The measured time interval is compared with the preset minimum integration step. If the measured time interval reaches or exceeds the preset minimum integration step, the next data processing is triggered; otherwise, continue to wait until the minimum integration step is reached.
10. A dynamic LED matrix display method and system based on accelerometer data according to claim 1, characterized in that: If the system continues to run, steps S103 to S108 are executed cyclically to achieve a dynamic LED matrix display effect. Specifically, the steps include: The entire loop execution process is managed to ensure that steps S103 to S108 are executed continuously and cyclically. According to step S103 , the cyclic control unit periodically reads data from the accelerometer and the gyroscope. According to steps S104 to S108, the loop control unit continuously calculates acceleration, updates pixel status, processes boundary collision, and draws pixel points. The loop control unit ensures that the LED matrix display content is updated in real time according to the latest data processing results.