Programmable light source control method and device, electronic equipment and computer storage medium
The light source control system using the QT interface and I²C channels solves the problems of limited functionality and low interaction efficiency in traditional light source control systems, and achieves precise control of multi-channel light sources and easy-to-use graphical management.
Patent Information
- Application Number
- CN202610093663.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-23
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional programmable light source control systems have limited functionality, poor scalability, low human-computer interaction efficiency, and cannot achieve precise control of multi-channel light sources or user-friendly graphical interaction.
The system uses a QT interface to receive configuration values input by the user, monitors the GPIO status through the I²C channel and controls the light source output, realizing integrated visual management of the light source working mode and GPIO output, and supporting input trigger mode, constant light mode and strobe mode.
It achieves rich functional expansion and efficient human-computer interaction. The system can perform a variety of functions according to different configuration values. The graphical interface is intuitive and easy to operate, improving control accuracy and user experience.
Smart Images

Figure CN121842913A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, in particular to a programmable light source control method and device, electronic equipment and computer storage medium. BACKGROUND
[0002] With the rapid development of industrial automation, intelligent lighting and precision detection technology, programmable light source control systems are increasingly widely used in machine vision, biomedical, semiconductor detection and other fields. Such systems need to achieve precise control of parameters such as brightness, strobe mode, external trigger synchronization of multi-channel light sources, and have a user-friendly graphical interface. Traditional control systems mostly rely on embedded bare machine programs or simple command line tools, which have problems such as single function, poor expandability, and low human-computer interaction efficiency. SUMMARY
[0003] In order to overcome the deficiencies of the prior art, the present application provides a programmable light source control method, device, electronic equipment and computer storage medium, taking QT as the human-computer interface and I2C as the data channel, to realize integrated visual management of GPIO state monitoring, DO / light source output configuration, external trigger logic and delay parameters, taking into account real-time, ease of use and cross-platform.
[0004] The first aspect of the present application provides a programmable light source control method, the method comprising: When a user input work mode register configuration value is received through a QT interface, determining a light source work mode corresponding to the work mode register configuration value, and controlling a light source drive circuit to output a PWM signal to a light source according to the light source work mode; When a user output GPIO trigger source register configuration value is received through the QT interface, determining a GPIO output control mode corresponding to the GPIO trigger source register configuration value, and controlling the level output of a GPIO output interface according to the GPIO output control mode.
[0005] In an optional implementation, the light source work mode includes an input trigger mode, and when the light source work mode is determined to be the input trigger mode, the control of the light source drive circuit to output the PWM signal to the light source according to the light source work mode includes: Monitoring the level change of a GPIO input interface specified by the GPIO trigger source register; When the level change of the GPIO input interface matches the edge of the trigger level register configuration, starting an internal timer; the edge includes a rising edge and a falling edge; When the internal timer reaches the configured value of the on-delay register, set the light source PWM duty cycle to the configured value of the PWM control register; the PWM control register is used to set the PWM duty cycle of the four light source LEDs respectively, to control the brightness control value range of the four light source LEDs is 0-100, the default value is 0; When the trigger is detected again, start the internal timer, and turn off the light source when the internal timer reaches the configured value of the off-delay register.
[0006] In an optional embodiment, the light source working mode further includes a constant-on mode, and when it is determined that the light source working mode is the constant-on mode, the controlling the light source driving circuit to output the PWM signal to the light source according to the light source working mode includes: reading the PWM brightness value configured by the PWM control register as the light source PWM duty cycle, and outputting the light source PWM duty cycle to the light source driving circuit to control the light source to continuously emit light at the PWM brightness value.
[0007] In an optional embodiment, the light source working mode further includes a stroboscopic mode, and when it is determined that the light source working mode is the stroboscopic mode, the controlling the light source driving circuit to output the PWM signal to the light source according to the light source working mode includes: taking the configured value of the stroboscopic interval register as the period, and cyclically performing the following operations: setting the light source PWM duty cycle to the maximum brightness value, and the duration is half of the stroboscopic interval value configured by the stroboscopic interval register; set the light source PWM duty cycle to the minimum brightness value, and the duration is half of the stroboscopic interval value.
[0008] In an optional embodiment, the method further includes: receiving a light source working mode parameter input by a user, including: when it is determined that the user selects the input trigger mode, receiving a first trigger source, an on-delay time, an off-delay time and a first brightness value input by the user, and writing the first trigger source, the on-delay time, the off-delay time and the first brightness value to the working mode register; when it is determined that the user selects the constant-on mode, receiving a second brightness value input by the user, and writing the second brightness value to the working mode register; when it is determined that the user selects the stroboscopic mode, receiving a stroboscopic time interval input by the user, and writing the stroboscopic time interval to the working mode register; receiving the user input GPIO trigger parameter, including: when it is determined that the GPIO trigger is enabled, receiving the user input second trigger source, trigger level, post-trigger DO output state and delay action time, and writing the second trigger source, the trigger level, the post-trigger DO output state and the delay action time to the GPIO trigger source register; when it is determined that the GPIO trigger is not enabled, setting the configuration value parameter to an invalid value; reading the return values of the working mode register and the GPIO trigger source register, and determining whether the return values are consistent with the written values; when it is determined that the return values are consistent with the written values, it is determined that the light source control parameter configuration is successful.
[0009] In an optional embodiment, the method further comprises: when it is determined that the user selects the input trigger mode, configuring the register identification bit of the input trigger mode to a first configuration value; when it is determined that the user selects the constant-on mode, configuring the register identification bit of the constant-on mode to a second configuration value; when it is determined that the user selects the strobe mode, configuring the register identification bit of the strobe mode to a third configuration value.
[0010] The second aspect of the present application provides a programmable light source control device, the device comprising: a light source working mode control module, configured to determine the light source working mode corresponding to the working mode register configuration value received through the QT interface when the user input working mode register configuration value is received through the QT interface, and control the light source driving circuit to output a PWM signal to the light source according to the light source working mode; a GPIO output mode control module, configured to determine the GPIO output control mode corresponding to the GPIO trigger source register configuration value received through the QT interface when the user output GPIO trigger source register configuration value is received through the QT interface, and control the level output of the GPIO output interface according to the GPIO output control mode.
[0011] The third aspect of the present application provides an electronic device, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to realize the steps of the programmable light source control method.
[0012] The fourth aspect of the present application provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to realize the steps of the programmable light source control method.
[0013] To sum up, the programmable light source control method, device, electronic equipment and computer storage medium provided by the application have at least the following beneficial effects: 1. The working mode of the light source is determined by receiving the working mode register configuration value input by the user, and the PWM signal output by the light source driving circuit to the light source is controlled; at the same time, the GPIO trigger source register configuration value output by the user is received to determine the GPIO output control mode, and the level output of the GPIO output interface is controlled, so that the system can realize various functions according to different configuration values, the functions are more diverse, and the functions are convenient to expand through the register configuration mode.
[0014] 2. The QT interface is used to receive the configuration value input by the user, the QT interface belongs to the graphical interactive interface, the graphical interface is more intuitive and easy to operate, the user can input the configuration information more conveniently and quickly, and therefore the human-computer interaction efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0015] Figure 1 Fig. 1 is a structural schematic diagram of a programmable light source control system according to an embodiment of the application; Figure 2 Fig. 2 is a flow schematic diagram of a programmable light source control method according to an embodiment of the application; Figure 3 Fig. 3 is another flow schematic diagram of a programmable light source control method according to an embodiment of the application; Figure 4 Fig. 4 is a schematic diagram of a light source control interface according to an embodiment of the application; Figure 5 Fig. 5 is a functional module diagram of a programmable light source control device according to an embodiment of the application; Figure 6 Fig. 6 is a structural schematic diagram of an electronic equipment according to an embodiment of the application. DETAILED DESCRIPTION
[0016] The application will be further described below in combination with the drawings and embodiments.
[0017] The concept, specific structure and generated technical effects of the present application will be described clearly and completely in combination with the embodiments and drawings, so as to fully understand the purpose, features and effects of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments, and other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative labor are within the protection scope of the present application. In addition, all the coupling / connection relationships involved in the patent do not mean that the components are directly connected, but that a better coupling structure can be composed by adding or reducing coupling accessories according to the specific implementation. The technical features in the present application can be combined interactively without conflict.
[0018] In the implementation of the MCU-based light source control system, it is necessary to correctly configure and use the registers of the MCU. The user can modify the register value of the MCU through I 2 C communication to control the light source and DO, and subsequently when the light source needs to be controlled, the register configuration value is controlled or the register configuration value is modified for control. In order to facilitate understanding of the inventive idea of the present application, the register configuration is first described in the embodiments of the present application. Specifically: The parameter configuration of register 0x01 (MCU_VID) is as shown in Table 1.
[0019] Table 1:
[0020] The parameter configuration of register 0x02 (MCU_PID) is as shown in Table 2.
[0021] Table 2:
[0022] The parameter configuration of register 0x11 (MCU_VERSION) is as shown in Table 3.
[0023] Table 3:
[0024] The parameter configuration of register 0x20 (MCU_BANK0_1_GPIO_PWR) is as shown in Table 4.
[0025] Table 4:
[0026] The parameter configuration of register 0x21 (MCU_BANK0_1_GPOX) is as shown in Table 5.
[0027] Table 5:
[0028] The parameter configuration of register 0x22 (MCU_BANK0_1_GPIX) is as shown in Table 6.
[0029] Table 6:
[0030] The parameter configuration of register 0x23 (MCU_LED1_PWM) is as shown in Table 7.
[0031] Table 7:
[0032] The parameter configuration of register 0x24 (MCU_LED2_PWM) is as shown in Table 8.
[0033] Table 8:
[0034] The parameter configuration of register 0x25 (MCU_LED3_PWM) is as shown in Table 9.
[0035] Table 9:
[0036] The parameter configuration of register 0x26 (MCU_LED4_PWM) is as shown in Table 10.
[0037] Table 10:
[0038] The parameter configuration of register 0x27 (MCU_ALL_LED_PWM) is as shown in Table 11.
[0039] Table 11:
[0040] The parameter configuration of register 0x28 (MCU_LED_CONTROL_MODE) is as shown in Table 12.
[0041] Table 12:
[0042] The parameter configuration of register 0x29 (MCU_GPOX_CONTROL_MODE) is as shown in Table 13.
[0043] Table 13:
[0044] The parameter configuration of register 0x2A (MCU_LED1_TRIGGER_SOURCE) is as shown in Table 14.
[0045] Table 14:
[0046] The parameter configuration of register 0x2B (MCU_LED2_TRIGGER_SOURCE) is shown in Table 15.
[0047] Table 15:
[0048] The parameter configuration of register 0x2C (MCU_LED3_TRIGGER_SOURCE) is shown in Table 16.
[0049] Table 16:
[0050] The parameter configuration of register 0x2D (MCU_LED4_TRIGGER_SOURCE) is shown in Table 17.
[0051] Table 17:
[0052] The parameter configuration of register 0x2E (MCU_LED1_ON_DELAY_L) is shown in Table 18.
[0053] Table 18:
[0054] The parameter configuration of register 0x2F (MCU_LED1_ON_DELAY_H) is shown in Table 19.
[0055] Table 19:
[0056] The parameter configuration of register 0x30 (MCU_LED2_ON_DELAY_L) is shown in Table 20.
[0057] Table 20:
[0058] The parameter configuration of register 0x31 (MCU_LED2_ON_DELAY_H) is shown in Table 21.
[0059] Table 21:
[0060] The parameter configuration of register 0x32 (MCU_LED3_ON_DELAY_L) is shown in Table 22.
[0061] Table 22:
[0062] The parameter configuration of register 0x33 (MCU_LED3_ON_DELAY_H) is as shown in Table 23.
[0063] Table 23:
[0064] The parameter configuration of register 0x34 (MCU_LED4_ON_DELAY_L) is as shown in Table 24.
[0065] Table 24:
[0066] The parameter configuration of register 0x35 (MCU_LED4_ON_DELAY_H) is as shown in Table 25.
[0067] Table 25:
[0068] The parameter configuration of register 0x36 (MCU_LED1_ON_DELAY_L) is as shown in Table 26.
[0069] Table 26:
[0070] The parameter configuration of register 0x37 (MCU_LED1_ON_DELAY_H) is as shown in Table 27.
[0071] Table 27:
[0072] The parameter configuration of register 0x38 (MCU_LED2_ON_DELAY_L) is as shown in Table 28.
[0073] Table 28:
[0074] The parameter configuration of register 0x39 (MCU_LED2_ON_DELAY_H) is as shown in Table 29.
[0075] Table 29:
[0076] The parameter configuration of register 0x3A (MCU_LED3_ON_DELAY_L) is as shown in Table 30.
[0077] Table 30:
[0078] The parameter configuration of register 0x3B (MCU_LED3_ON_DELAY_H) is shown in Table 31.
[0079] Table 31:
[0080] The parameter configuration of register 0x3C (MCU_LED4_ON_DELAY_L) is shown in Table 32.
[0081] Table 32:
[0082] The parameter configuration of register 0x3D (MCU_LED4_ON_DELAY_H) is shown in Table 33.
[0083] Table 33:
[0084] The parameter configuration of register 0x3E (MCU_LED1_STROBE_TIME_L) is shown in Table 34.
[0085] Table 34:
[0086] The parameter configuration of register 0x3F (MCU_LED1_STROBE_TIME_H) is shown in Table 35.
[0087] Table 35:
[0088] The parameter configuration of register 0x40 (MCU_LED2_STROBE_TIME_L) is shown in Table 36.
[0089] Table 36:
[0090] The parameter configuration of register 0x41 (MCU_LED2_STROBE_TIME_H) is shown in Table 37.
[0091] Table 37:
[0092] The parameter configuration of register 0x42 (MCU_LED3_STROBE_TIME_L) is shown in Table 38.
[0093] Table 38:
[0094] The parameter configuration of register 0x43 (MCU_LED3_STROBE_TIME_H) is as shown in Table 39.
[0095] Table 39:
[0096] The parameter configuration of register 0x44 (MCU_LED4_STROBE_TIME_L) is as shown in Table 40.
[0097] Table 40:
[0098] The parameter configuration of register 0x45 (MCU_LED4_STROBE_TIME_H) is as shown in Table 41.
[0099] Table 41:
[0100] The parameter configuration of register 0x46 (MCU_BANK0_GPO1_TRIGGER_SOURCE) is as shown in Table 42.
[0101] Table 42:
[0102] The parameter configuration of register 0x47 (MCU_BANK0_GPO2_TRIGGER_SOURCE) is as shown in Table 43.
[0103] Table 43:
[0104] The parameter configuration of register 0x48 (MCU_BANK0_GPO3_TRIGGER_SOURCE) is as shown in Table 44.
[0105] Table 44:
[0106] The parameter configuration of register 0x49 (MCU_BANK0_GPO4_TRIGGER_SOURCE) is as shown in Table 45.
[0107] Table 45:
[0108] The parameter configuration of register 0x4A (MCU_BANK0_GPO5_TRIGGER_SOURCE) is as shown in Table 46.
[0109] Table 46:
[0110] The parameter configuration of register 0x4B (MCU_BANK0_GPO6_TRIGGER_SOURCE) is shown in Table 47.
[0111] Table 47:
[0112] The parameter configuration of register 0x4C (MCU_BANK0_GPO7_TRIGGER_SOURCE) is shown in Table 48.
[0113] Table 48:
[0114] The parameter configuration of register 0x4D (MCU_BANK0_GPO8_TRIGGER_SOURCE) is shown in Table 49.
[0115] Table 49:
[0116] The parameter configuration of register 0x4E (MCU_BANK0_GPOx_TRIGGER_SOURCE) is shown in Table 50.
[0117] Table 50:
[0118] The parameter configuration of register 0x4F (MCU_BANK0_GPO1_TRIGGER_DELAY_L) is shown in Table 51.
[0119] Table 51:
[0120] The parameter configuration of register 0x50 (MCU_BANK0_GPO1_TRIGGER_DELAY_H) is shown in Table 52.
[0121] Table 52:
[0122] The parameter configuration of register 0x51 (MCU_BANK0_GPO2_TRIGGER_DELAY_L) is shown in Table 53.
[0123] Table 53:
[0124] The parameter configuration of register 0x52 (MCU_BANK0_GPO2_TRIGGER_DELAY_H) is as shown in Table 54.
[0125] Table 54:
[0126] The parameter configuration of register 0x53 (MCU_BANK0_GPO3_TRIGGER_DELAY_L) is as shown in Table 55.
[0127] Table 55:
[0128] The parameter configuration of register 0x54 (MCU_BANK0_GPO3_TRIGGER_DELAY_H) is as shown in Table 56.
[0129] Table 56:
[0130] The parameter configuration of register 0x55 (MCU_BANK0_GPO4_TRIGGER_DELAY_L) is as shown in Table 57.
[0131] Table 57:
[0132] The parameter configuration of register 0x56 (MCU_BANK0_GPO4_TRIGGER_DELAY_H) is as shown in Table 58.
[0133] Table 58:
[0134] The parameter configuration of register 0x57 (MCU_BANK0_GPO5_TRIGGER_DELAY_L) is as shown in Table 59.
[0135] Table 59:
[0136] The parameter configuration of register 0x58 (MCU_BANK0_GPO5_TRIGGER_DELAY_H) is as shown in Table 60.
[0137] Table 60:
[0138] The parameter configuration of register 0x59 (MCU_BANK0_GPO6_TRIGGER_DELAY_L) is as shown in Table 61.
[0139] Table 61:
[0140] The parameter configuration of register 0x5A (MCU_BANK0_GPO6_TRIGGER_DELAY_H) is as shown in Table 62.
[0141] Table 62:
[0142] The parameter configuration of register 0x5B (MCU_BANK0_GPO7_TRIGGER_DELAY_L) is as shown in Table 63.
[0143] Table 63:
[0144] The parameter configuration of register 0x5C (MCU_BANK0_GPO7_TRIGGER_DELAY_H) is as shown in Table 64.
[0145] Table 64:
[0146] The parameter configuration of register 0x5D (MCU_BANK0_GPO8_TRIGGER_DELAY_L) is as shown in Table 65.
[0147] Table 65:
[0148] The parameter configuration of register 0x5E (MCU_BANK0_GPO8_TRIGGER_DELAY_H) is as shown in Table 66.
[0149] Table 66:
[0150] The parameter configuration of register 0x5F (MCU_BANK0_1_GPOx_TRIGGER_OUTPUT_LEVEL) is as shown in Table 67.
[0151] Table 67:
[0152] The parameter configuration of register 0x60 (MCU_UPDATE_CTRL) is as shown in Table 68.
[0153] Table 68:
[0154] Based on the above description, for the light source control register configuration, the working mode of the light source is controlled by the MCU_LED_CONTROL_MODE register (address 0x28), which defines three working modes of the light source: input trigger mode (0), constant mode (1) and stroboscopic mode (2). For the GPIO management register configuration, the system monitors the state of all GPIO inputs in real time, and the change can be used as a trigger source to link the behavior of the light source and DO. The GPIO input state is read through the MCU_BANK0_1_GPIX register (such as 0x22); the GPIO output (DO) supports two modes: DI trigger mode (0) and manual mode (1), which is controlled by the MCU_GPOX_CONTROL_MODE register (address 0x29). For the light source setting register configuration, the trigger source of each light source is set by the MCU_LEDx_TRIGGER_SOURCE register (such as 0x2A-0x2D), which can select DI_1 to DI_4 as the trigger source. And the opening and closing delay time of the light source is set by the MCU_LEDx_ON_DELAY_L / H and MCU_LEDx_OFF_DELAY_L / H registers (such as 0x2E-0x3D), with a unit of milliseconds (ms) and a range of 0-999ms. And the brightness of each light source is set by the MCU_LEDx_PWM register (such as 0x23-0x26), with a control value of 0-100, representing the percentage of PWM duty cycle. In addition, it also includes system upgrade register configuration, the system supports MCU firmware upgrade through I2C communication, and the upgrade process is controlled by the MCU_UPDATE_CTRL register (address 0x60).
[0155] Referring to Figure 1 As shown in FIG. 1, a programmable light source control system according to an embodiment of the present application is shown, which is composed of a hardware layer, a communication layer and a software layer. The hardware layer is a hardware control module, the communication layer is a communication protocol module, and the software layer is a software control module.
[0156] In some embodiments, the hardware control module takes an embedded microcontroller (MCU) as the core to control the whole machine GPIO interface and light source channel. The MCU serves as an I²C slave device to provide a register interface and respond to the commands of the host controller. Among them, the I²C device address of the MCU is 0x15, the communication mode is byte mode, and it is mounted on / dev / i2c-2 on the system. The MCU can select GD32F303CET6 MCU, which integrates 4 groups of 16-bit timers (supporting PWM output), 16-channel GPIO and I²C slave modules, to meet the multi-channel light source control requirements. The GPIO interface includes digital input interface (DI_1~8) and digital output interface (DO1~8), which connects external sensors or trigger signal sources (such as photoelectric switches, keys) through digital input interface, monitors the level change through the GPIO input mode (configured as pull-up / pull-down resistor) of the MCU; and connects status indicator lights or alarm devices through digital output interface, and controls high and low level through GPIO output mode (such as DO1 connects LED, high level lights up). The light source channel (PWM drive of CH1~4) uses the timer (TIM1~TIM4) of the MCU to generate PWM signals to drive LED light sources or lasers, and the PWM resolution is 12 bits (0%~100% brightness adjustment), and the frequency can be set to 1kHz~20kHz to avoid flicker.
[0157] The communication protocol module connects the MCU and the RK3588 mainboard (running Ubuntu 20.04) through the I²C protocol to ensure real-time data transmission. The RK3588 provides a standard I²C driver to expose device nodes for upper-layer software access.
[0158] The software control module develops a graphical interface based on the QT framework to provide a visual control panel integrating level monitoring, light source adjustment and trigger logic configuration functions. The QT application transmits communication with the MCU by operating the I²C device node to realize command issuing and data reading.
[0159] In order to facilitate understanding of the inventive idea of the programmable light source control system of the present application, the working principle of the programmable light source control system is described from different execution sides as follows.
[0160] MCU side implementation: GD32F303CET6 MCU runs a firmware program and is configured as an I²C slave device. The MCU provides a register interface, and the MCU controls the related logic according to the value of the register. The RK3588 side can read and write related registers to read the DI state of the MCU and set the working state of the light source and DO.
[0161] RK3588 side drive: on the Ubuntu system, enable the standard I²C driver to create device nodes. The driver provides standard read / write / ioctl interfaces to support communication with the MCU.
[0162] QT application: the interface is built using the GUI components of QT, which realizes the transparent communication with the MCU by operating the I²C device node. For example, when the user controls the trigger source of the light source CH1 to be DI_1, the light source is turned on after a delay of 100 ms and then turned off after a delay of 500 ms, the QT application collects the data of the trigger source, the delay of turning on and the delay of turning off, and writes the data to the corresponding register of the MCU through the operation of the I²C device node. After the MCU receives the register data, it controls the function of the light source.
[0163] Through the multi-channel light source control system with QT as the human-computer interface and I²C as the data channel, the integrated visual management of GPIO state monitoring, DO / light source output configuration, external trigger logic and delay parameter is realized, and real-time, ease of use and cross-platform are taken into account. Among them, the QT framework ensures the stable operation of the interface on the Ubuntu system, and the cross-platform characteristics of QT can be adapted to Windows system or other distribution Linux system; the I²C communication protocol is standardized, the driver compatibility is strong, and the stable data transmission of RK3588 and MCU is ensured.
[0164] Referring to Figure 2 Fig. 1 is a flowchart of a programmable light source control method according to an embodiment of the present application. The programmable light source control method comprises the following steps.
[0165] S21, when receiving the working mode register configuration value input by the user through the QT interface, determining the light source working mode corresponding to the working mode register configuration value, and controlling the light source driving circuit to output the PWM signal to the light source according to the light source working mode.
[0166] When the system is powered on, first load the standard I²C driver on the Ubuntu system, create the device node (such as / dev / I²C-*), and verify the accessibility of the device node. If it fails, an error is reported and the program exits. Then, read the hardware configuration and initialize the default parameters. Specifically, the QT application reads the light source working mode (such as constant-on mode), GPIO trigger mode (such as disabled) and other parameters from the configuration file or the preset default value according to the valid I²C device node path (such as / dev / I²C-1), encodes the default parameters into binary data, and prepares to write them into the MCU register. Then, write the light source working mode data packet into the working mode register of the MCU through the I²C device node. Read the return value of the register and verify the success of the writing.
[0167] In an alternative embodiment, before starting the light source control, the user needs to configure the parameters of different working modes of the light source to ensure that the light source can work stably according to the user's needs. The system first receives the user's configuration for the light source working mode, GPIO input and output, light source parameter and power control, etc. through the user interaction interface (such as touch screen, upper computer software or serial port instruction). Specifically, it includes: Light source working mode configuration: set the working mode of the light source by writing the working mode register of the MCU. The light source working mode includes input trigger mode, constant light mode and stroboscopic mode. Different configuration values of the working mode register represent different working modes. The first configuration value 0 represents the input trigger mode, the second configuration value 1 represents the constant light mode, and the third configuration value 2 represents the stroboscopic mode. For example, if the light source needs to be turned on only when receiving an external trigger signal, the input trigger mode is selected.
[0168] (1) Input trigger mode configuration: A, register identification bit setting: configure the identification bit of the working mode register to the first configuration value (for example, 0) to identify the current mode as the input trigger mode (i.e. DI trigger mode).
[0169] B, parameter receiving and writing: receive the user's input of the first trigger source (such as "DI_1" or "external PWM signal"), the on-delay time (such as "50ms"), the off-delay time (such as "100ms") and the first brightness value (such as "80%"); After converting the above parameters into binary code according to the register protocol, write them into the corresponding fields of the working mode register.
[0170] (2) Constant light mode configuration: A, register identification bit setting: configure the identification bit of the working mode register to the second configuration value (for example, 1).
[0171] B, parameter receiving and writing: receive the user's input of the second brightness value (such as "100%") and write it into the brightness field of the working mode register, while setting other mode related fields (such as trigger source, delay time) to invalid values (such as 0xFF).
[0172] (3) Stroboscopic mode configuration: A, register identification bit setting: configure the identification bit of the working mode register to the third configuration value (for example, 2); B, parameter receiving and writing: receive the user's input of the stroboscopic time interval (such as "200ms") and write it into the stroboscopic interval field of the working mode register after converting it into the register clock period unit.
[0173] Meanwhile, the system also supports GPIO trigger function, and the user can select whether to enable the function through the interface. When the GPIO trigger is enabled, the user needs to input the following parameters, including: the second trigger source (such as "DI_2", wherein the trigger source uses DI_x), the trigger level (such as "low level trigger"), the DO output state after triggering (such as "output high level"), and the delay action time (such as "10ms"). And these parameters are written into the GPIO trigger source register (that is, 0x29 (MCU_GPOX_CONTROL_MODE)). Specifically, 0~3bit bits are respectively set as control DO_1~4 control mode, 0 corresponds to DI trigger mode, and 1 corresponds to manual mode; 4~7bit bits control DO_5~8 control mode, 0 corresponds to DI trigger mode, and 1 corresponds to manual mode.
[0174] GPIO input and output configuration: (1) Input (DI) configuration: Determine the GPIO input port to be monitored, and the state change of these input ports will be used as the condition for triggering the light source control. For example, DI_1 can be set as the trigger source, and the trigger level thereof is specified as rising edge or falling edge.
[0175] (2) Output (DO) configuration: The output mode of DO is set through the GPIO trigger source register. The DO control module includes trigger mode and manual mode, 0 represents DI trigger mode, and 1 represents manual mode. In the trigger mode, the output of DO will be controlled by the input state of DI, and the manual mode is not effective. The trigger source DI_1~8 of DO can be set, the trigger level of the trigger source is rising edge or falling edge, the trigger delay action time is 0~999ms, and the output state of DO after triggering is high or low. The corresponding register value of the trigger control is written to the MCU, and the MCU controls the trigger mode logic of the GPIO according to the register value. In the manual mode, the output of DO is directly set through the 0x5F register. The 0x5F register contains eight bit bits, which respectively control eight DO, 0 represents that the output is low, and 1 represents that the output is high.
[0176] Power control configuration: The power control can control the power of DO and DI. Specifically, the power control register value is written to the MCU, and the MCU controls the power according to the register value. Among them, the 0~3 bit bits of the power control register respectively control the power of DO and DI, 0 represents that the power is off, and 1 represents that the power is on.
[0177] When the cycle control of the light source needs to be performed, the system performs the light source control according to the light source working mode selected by the user and based on the parameters configured based on the light source working mode. That is, the system continuously monitors the states of all configured GPIO input ports, and once a valid trigger signal (such as a rising edge or a falling edge) is detected, the system will perform corresponding processing according to the current light source working mode.
[0178] When it is monitored that the configuration value of the working mode register selected by the user is 0, that is, the system performs the light source control according to the input trigger mode. The system continuously monitors the specified GPIO input port, and when a valid trigger signal (such as a rising edge / falling edge) is detected, an internal delay timer is started; after the delay ends, the light source is automatically turned on or off. Specifically, the system continuously monitors the level change of the GPIO input interface specified by the GPIO trigger source register. For example, if the GPIO trigger source register is configured to monitor the DI_1 interface, the system will pay attention to the level state of DI_1 in real time. When the system detects that the level change of the DI_1 interface matches the edge (rising edge or falling edge) configured in the trigger level register, it is determined that a valid trigger signal is received. For example, if the trigger level register is configured to detect the rising edge, when the level of the DI_1 interface jumps from low to high, the system considers it as a valid trigger. Once a valid trigger signal is detected, the system immediately starts an internal timer and begins timing. The timing duration of this timer is determined by the configuration value of the on-delay register, which can be set in the range of 0-999 ms. When the internal timer reaches the configuration value of the on-delay register, the system sets the PWM duty cycle of the light source to the value configured in the PWM control register. For example, if the PWM control register is configured to 50%, the light source will be turned on at 50% brightness. After the light source is turned on, the system continues to monitor the GPIO input interface. When an edge signal matching the configuration of the trigger level register is detected again (i.e., triggered again), the system restarts the internal timer. The timing duration of this timer is determined by the configuration value of the off-delay register. When the internal timer reaches the configuration value of the off-delay register, the system automatically turns off the light source, completing a complete light source control cycle.
[0179] In the input trigger mode, the programmable light source control system can accurately control the on and off timing and brightness of the light source according to the user-configured parameters and external trigger signals, meeting the light source control requirements in different application scenarios.
[0180] When the configuration value of the user-selected working mode register is monitored to be 1, that is, the system performs light source control according to the constant mode. The system ignores all trigger signals, directly sets all light sources to the PWM brightness value specified in the configuration, and always maintains this state. Specifically, the system reads the pre-configured PWM brightness value in the PWM control register (that is, the 0x23, 0x24, 0x25, 0x26 register). This register has been assigned a specific value during the system initialization stage or when the user sets it through a specific configuration interface, and this value accurately corresponds to the brightness level required by the light source. The system directly uses the read PWM brightness value as the PWM duty cycle of the light source. Subsequently, the system quickly and accurately outputs the determined PWM duty cycle of the light source to the light source drive circuit. After receiving the PWM duty cycle signal, the light source drive circuit immediately drives the light source according to this signal, so that the light source can continuously and stably emit light at the PWM brightness value configured in the PWM control register. During the entire constant mode operation, the light source will always maintain this set brightness state and will not flicker or fluctuate in brightness, providing a stable and reliable lighting environment for the user.
[0181] When the configuration value of the user-selected working mode register is monitored to be 2, that is, the system performs light source control according to the strobe mode. The system causes the light source to cycle between maximum brightness and off state based on an independent time parameter (that is, the configuration value of the strobe interval register), forming a flickering effect. Specifically, the system reads the configured strobe interval value (strobe_interval) from the strobe interval register, that is, the 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, and 0x45 registers, which determines the duration of the entire strobe cycle. The system uses the read strobe interval value (strobe_interval) as a complete cycle to repeatedly perform the following two operations: Maximum brightness phase: set the PWM duty cycle of the light source to the maximum brightness value (usually 100%), and maintain this state for half the duration of the strobe interval value (strobe_interval / 2). During this period, the light source emits light at maximum brightness.
[0182] Off phase: immediately after, set the PWM duty cycle of the light source to the minimum brightness value (usually 0%, that is, the off state), and also maintain this state for half the duration of the strobe interval value (strobe_interval / 2). During this period, the light source is in the off state.
[0183] The above-described maximum brightness and off phases are continuously cycled to create a sustained and stable flickering effect. Simultaneously, the system allows users to adjust the flicker frequency and period by modifying the value of the flicker interval register, enabling more flexible and personalized light source control. In flicker mode, the programmable light source control system can precisely and stably control the flickering effect of the light source, meeting the specific dynamic control requirements of different application scenarios.
[0184] Therefore, users can select different light source working modes through the QT graphical interface, and the light source settings interface will change to adapt to the selected mode. For example, when the trigger mode is selected, the interface will display the setting options specific to the trigger mode, see [link / reference]. Figure 4 The diagram shows the interface when the light source is set to trigger mode. In trigger mode, the light source can be set to trigger source DI_1 to DI_4, and the light source turn-on delay time (0~999ms), light source turn-off delay time (0~999ms), and light source brightness (0~100%) can be set. By writing the corresponding light source control register value to the MCU, the MCU controls the light source mode according to the register value. For example, if DI_2 is selected as the trigger source, when the DI_2 interface receives a signal that meets the trigger conditions, it will trigger the light source to work according to the preset parameters. If the light source turn-on delay time is set to 150ms, the light source will turn on after a 150ms delay after the trigger source signal is valid. Similarly, the user can set the light source turn-off delay time within the range of 0 to 999ms. If the light source turn-off delay time is set to 250ms, the light source will automatically turn off after a 250ms delay after being turned on. The user can adjust the light source brightness within the range of 0 to 100%. If the light source brightness is set to 70%, the light source will work at that brightness value.
[0185] It should be noted that the light source operating modes are not compatible; only one mode is allowed to run at a time. Furthermore, all delay time parameters are handled via the SysTick_Handler interrupt, ensuring that delay events do not affect the operation of other programs and guaranteeing real-time performance.
[0186] S22, when the GPIO trigger source register configuration value output by the user is received through the QT interface, the GPIO output control mode corresponding to the GPIO trigger source register configuration value is determined, and the level output of the GPIO interface is controlled according to the GPIO output control mode.
[0187] When receiving the configuration value of the GPIO trigger source register input by the user, the configuration value is parsed and the corresponding GPIO output (DO) control mode is determined to realize the linkage control of the light source and the external device. The system monitors the value of the GPIO trigger source register in real time, and once a change is detected, the value is immediately read. The system internally pre-stores a correspondence table of different GPIO trigger source register configuration values and GPIO output control modes, and by querying the table, the system determines that the GPIO output control mode corresponding to the current configuration value is to output a high level when a specific rising edge trigger signal is detected.
[0188] When the light source control is performed, the configuration value of the GPIO trigger source register input by the user is received, and when the configuration value is 0, the DI trigger mode is entered, the DI port (DI_1~DI_8) is bound as the trigger source through the trigger control register (address 0x2A), and the trigger level (0=falling edge, 1=rising edge) is set. When a valid trigger occurs in the specified DI input, the delay time after the trigger (range 0~999ms) is configured through the delay time register (address 0x2B), the level output state of the GPIO interface is automatically changed, and then the output level of the DO port after the trigger (0=low, 1=high) is configured through the DO output state register (address 0x2C). When the bound DI port detects a valid trigger, the MCU starts the delay timer; after the delay ends, the MCU sets the level of the target DO port to the register value. If the configuration value is 1, the manual mode is entered, and the level output of the GPIO interface is directly set according to the 0x21 register value (eight bit positions respectively control eight DOs, each bit position corresponds to one DO, 0=low, 1=high) configured by the user. For example, the user configures 0x21=0b00001010, then DO_2 and DO_4 output high levels, and the remaining DOs output low levels.
[0189] In some examples, in order to enable the user to intuitively and conveniently master the real-time running state of the programmable light source control system, in the light source control process, the system can visually display the current GPIO input state, the current GPIO output state and the light source working state through the QT application program.
[0190] Reference Figure 3As shown, in the embodiments of the present application, during the operation of the programmable light source control system, first, the system is started to enter the starting stage, and then the MCU initialization operation is performed immediately, which lays a foundation for the subsequent implementation of various functions. After the completion of MCU initialization, the system enters the multi-task cooperative operation stage. On the one hand, the user can perform operation control through the QT page. The QT application program utilizes the characteristics of being developed based on the QT framework to build an intuitive and easy-to-use interface with rich GUI components. The user performs various setting and instruction issuing operations on the interface. These operations will trigger the RK3588 to read and write registers of the MCU. The RK3588, as the mainboard running Ubuntu 20.04, enables the standard I2C driver and creates a device node. Through the standard read / write / ioctl interface, stable data transmission is realized with the MCU as an I2C slave device according to the I2C protocol, and the read and write operations of the register are realized. On the other hand, the system synchronously performs I2C data reading and writing to ensure real-time interaction of data. Then, the MCU updates and writes the register to the FLASH data area, which ensures the persistent storage of data. Even if the system is temporarily powered off, the data will not be lost, providing data support for subsequent system recovery and continuous operation. After completing the data storage, the system enters the loop execution stage. According to the value of the register, the DI task logic is executed in turn, such as monitoring the state change of the GPIO input interface, and judging whether an effective trigger signal is received according to the preset trigger level and other conditions. Then, the DO task logic is executed. According to the output mode configured by the register, such as trigger mode or manual mode, the level output state of the GPIO output interface is controlled to realize the linkage control with external devices. Finally, the light source task logic is executed. According to the user-configured light source working mode, such as input trigger mode, constant light mode or stroboscopic mode, combined with the corresponding parameter settings, the opening, closing time and brightness of the light source are accurately controlled to meet the light source control requirements in different application scenarios. The whole process is repeated in a loop to continuously guarantee the stable operation and accurate control of the programmable light source control system.
[0191] Compared to existing technologies, this application, to meet the requirements of programmable light source control, uses a hardware approach where the MCU connects to the RK3588 via I²C. On the software side, the MCU implements an I²C slave device and provides a register interface. The RK3588 encapsulates a standard I²C read / write driver, providing an upper-level operation node. QT operates this node to read and write to the MCU registers, thereby controlling the light source. Deep integration of the QT graphical interface with the MCU hardware replaces command-line operations with visual operation, providing real-time feedback on level status and light source parameters, improving interaction efficiency and reducing errors. A unified platform manages GPIO, light sources, and trigger logic, supporting user-defined rules, enhancing functional integration, and shortening the development cycle. The QT and Linux-based hardware and software architecture ensures cross-platform compatibility and scalability to various embedded scenarios. It features external triggering and delay control functions, meeting industrial-grade timing requirements, achieving high-precision automation, improving system reliability, and greatly facilitating the control and programmable development of light sources in precision light source control fields. This application can be applied to fields requiring precision light source control, such as machine vision inspection, biomedical imaging, and intelligent lighting systems.
[0192] Reference Figure 5 The diagram shown is a functional block diagram of a programmable light source control device according to an embodiment of this application.
[0193] In some embodiments, the optically programmable light source control device 50 may include multiple functional modules composed of computer program segments. The computer programs for each program segment of the optically programmable light source control device 50 may be stored in the memory of an electronic device and executed by at least one processor to perform (see details). Figure 2 (Description) The function of controlling the programmable light source. Based on the functions it performs, it can be divided into multiple functional modules. These functional modules may include: a light source operating mode control module 501 and a GPIO output mode control module 502. The term "module" in this application refers to a series of computer program segments that can be executed by at least one processor and perform a fixed function, stored in memory. In this embodiment, the functions of each module will be detailed in subsequent embodiments.
[0194] The light source working mode control module 501 is used to determine the light source working mode corresponding to the working mode register configuration value when it receives the working mode register configuration value input by the user through the QT interface, and control the light source driving circuit to output a PWM signal to the light source according to the light source working mode. The GPIO output mode control module 502 is configured to determine a GPIO output control mode corresponding to the GPIO trigger source register configuration value output by the user through the QT interface, and control the level output of a GPIO output interface according to the GPIO output control mode.
[0195] It should be understood that various changes and modifications to the programmable light source control method provided by the above embodiments are also applicable to the light programmable light source control device of the present embodiment. Based on the detailed description of the programmable light source control method, those skilled in the art can clearly understand the implementation method of the light programmable light source control device in the present embodiment. For the sake of brevity of the description, it will not be described in detail here.
[0196] Referring to Figure 6 The electronic device 6 shown in the structure diagram of the electronic device according to the embodiments of the present application. In the preferred embodiments of the present application, the electronic device 6 includes a memory 61, at least one processor 62, and at least one communication bus 63.
[0197] Those skilled in the art should understand, Figure 6 The structure of the electronic device shown in the structure diagram of the electronic device according to the embodiments of the present application. In the preferred embodiments of the present application, the electronic device 6 includes a memory 61, at least one processor 62, and at least one communication bus 63.
[0198] In some embodiments, the electronic device 6 is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits, programmable gate arrays, digital processors and embedded devices, etc. The electronic device 6 can also include a user device, which includes but is not limited to any electronic product that can interact with the user through a keyboard, mouse, remote control, touchpad or voice control device, such as a personal computer, tablet computer, smart phone, digital camera, etc.
[0199] In the above embodiments provided by the present application, it should be understood that the disclosed method, device, computer readable storage medium and electronic device can be implemented by other ways. For example, the above- described device embodiments are only schematic, and the division of the modules is only a logical function division, and there can be another division way in actual implementation, for example, a plurality of components or modules can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed components can be indirect coupling or communication connection through some interfaces, devices or components or modules, which can be electrical, mechanical or other forms.
[0200] The components described as separate components may or may not be physically separate, and the components shown as components may or may not be physical modules, i.e., may be located in one place or distributed to multiple network modules. Part or all of the components can be selected according to actual needs to achieve the purpose of the embodiment.
[0201] In addition, the functional modules in each embodiment of the present application can be integrated in one processing module, or each component can be physically present separately, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module.
[0202] The integrated module, if realized in the form of a software functional module and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes. OnlyMemory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0203] It should be noted that for the foregoing method embodiments, in order to facilitate description, they are all expressed as a combination of a series of actions, but those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0204] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0205] The above is a specific description of the preferred embodiment of the present application, but the present application is not limited to the described embodiments. Those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.
Claims
1. A programmable light source control method, characterized in that, The method includes: When the working mode register configuration value input by the user is received through the QT interface, the working mode of the light source corresponding to the working mode register configuration value is determined, and the light source driving circuit is controlled to output a PWM signal to the light source according to the working mode of the light source. When the GPIO trigger source register configuration value output by the user is received through the QT interface, the GPIO output control mode corresponding to the GPIO trigger source register configuration value is determined, and the level output of the GPIO output interface is controlled according to the GPIO output control mode.
2. The programmable light source control method according to claim 1, characterized in that, The light source operating mode includes an input trigger mode. When the light source operating mode is determined to be an input trigger mode, controlling the light source driving circuit to output a PWM signal to the light source according to the light source operating mode includes: Monitor the level changes of the GPIO input interface specified by the GPIO trigger source register; When a level change detected at the GPIO input interface matches the edge configured in the trigger level register, an internal timer is started; the edge includes a rising edge and a falling edge. When the internal timer reaches the configured value of the delay register, the PWM duty cycle of the light source is set to the configured value of the PWM control register; the eight bits of the PWM control register control eight GPIO outputs respectively. When a trigger is detected again, the internal timer is started, and the light source is turned off when the configured value of the delay register is reached.
3. The programmable light source control method according to claim 2, characterized in that, The light source operating mode also includes a constant-on mode. When the light source operating mode is determined to be a constant-on mode, the step of controlling the light source driving circuit to output a PWM signal to the light source according to the light source operating mode includes: reading the PWM brightness value configured in the PWM control register as the PWM duty cycle of the light source, and outputting the PWM duty cycle of the light source to the light source driving circuit to control the light source to continuously emit light at the PWM brightness value.
4. The programmable light source control method according to claim 3, characterized in that, The light source operating mode also includes a strobe mode. When the light source operating mode is determined to be a strobe mode, controlling the light source driving circuit to output a PWM signal to the light source according to the light source operating mode includes: cyclically performing the following operations with the configuration value of the strobe interval register as the period: setting the PWM duty cycle of the light source to the maximum brightness value for a duration of half the strobe interval value configured in the strobe interval register; setting the PWM duty cycle of the light source to the minimum brightness value for a duration of half the strobe interval value.
5. The programmable light source control method according to claim 4, characterized in that, The method further includes: The system receives user-inputted light source operating mode parameters, including: when the user selects the input trigger mode, receiving the user-inputted first trigger source, on delay time, off delay time, and first brightness value, and writing the first trigger source, the on delay time, the off delay time, and the first brightness value to the operating mode register; when the user selects the constant-on mode, receiving the user-inputted second brightness value and writing the second brightness value to the operating mode register; and when the user selects the strobe mode, receiving the user-inputted strobe time interval and writing the strobe time interval to the operating mode register. The method for receiving GPIO trigger parameters input by the user includes: when it is determined that GPIO triggering is enabled, receiving the second trigger source, trigger level, DO output state after triggering, and delay action time input by the user, and writing the second trigger source, the trigger level, the DO output state after triggering, and the delay action time into the GPIO trigger source register; when it is determined that GPIO triggering is not enabled, setting the configuration value parameter to an invalid value; Read the feedback values of the working mode register and the GPIO trigger source register, and determine whether the feedback value is consistent with the written value; when it is determined that the feedback value is consistent with the written value, it is determined that the light source control parameters are configured successfully.
6. The programmable light source control method according to claim 5, characterized in that, The method further includes: When it is determined that the user selects an input trigger mode, the register flag bit of the input trigger mode is configured to the first configuration value; When it is determined that the user selects the always-on mode, the register flag bit of the always-on mode is configured to the second configuration value; When it is determined that the user selects the strobe mode, the register flag bit of the strobe mode is configured to the third configuration value.
7. The programmable light source control method according to claim 1, characterized in that, The method further includes: writing a power control 0x20 register configuration value to control the power state of the GPIO output interface and the GPIO input interface. Bits 0 to 3 of the 0x20 register control the two power supplies of the GPIO output interface and the GPIO input interface respectively. When the corresponding bit is set to 0, the corresponding power supply is turned off; when the corresponding bit is set to 1, the corresponding power supply is turned on.
8. A programmable light source control device, characterized in that, The device includes: The light source working mode control module is used to determine the light source working mode corresponding to the working mode register configuration value when the working mode register configuration value is received by the user through the QT interface, and control the light source driving circuit to output a PWM signal to the light source according to the light source working mode; The GPIO output mode control module is used to determine the GPIO output control mode corresponding to the GPIO trigger source register configuration value when the GPIO trigger source register configuration value is received by the user through the QT interface, and control the level output of the GPIO output interface according to the GPIO output control mode.
9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the programmable light source control method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the programmable light source control method according to any one of claims 1 to 7.
