CN115175410A - Breathing lamp implementation method and device, electrical equipment and storage medium - Google Patents

Breathing lamp implementation method and device, electrical equipment and storage medium Download PDF

Info

Publication number
CN115175410A
CN115175410A CN202210711818.9A CN202210711818A CN115175410A CN 115175410 A CN115175410 A CN 115175410A CN 202210711818 A CN202210711818 A CN 202210711818A CN 115175410 A CN115175410 A CN 115175410A
Authority
CN
China
Prior art keywords
timer
triggering
interrupt signal
trigger
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210711818.9A
Other languages
Chinese (zh)
Inventor
官新强
高秋英
王道河
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haier Smart Home Co Ltd
Chongqing Haier Front Loading Washing Machine Co Ltd
Original Assignee
Haier Smart Home Co Ltd
Chongqing Haier Front Loading Washing Machine Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Haier Smart Home Co Ltd, Chongqing Haier Front Loading Washing Machine Co Ltd filed Critical Haier Smart Home Co Ltd
Priority to CN202210711818.9A priority Critical patent/CN115175410A/en
Publication of CN115175410A publication Critical patent/CN115175410A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B47/00Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
    • H05B47/10Controlling the light source
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B47/00Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
    • H05B47/10Controlling the light source
    • H05B47/16Controlling the light source by timing means
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The embodiment of the invention discloses a breathing lamp implementation method, a breathing lamp implementation device, electrical equipment and a storage medium, wherein the method is applied to the electrical equipment, the electrical equipment comprises a single chip microcomputer and a light-emitting device, the single chip microcomputer is provided with a first timer and a second timer, and the method comprises the following steps: acquiring a first interrupt signal generated by triggering a first timer, and controlling the light-emitting device to be lightened on the basis of the first interrupt signal; acquiring a second interrupt signal generated by triggering of a second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal; determining whether the triggering times of the second timer reach the target times; and when the triggering times do not reach the target times, returning to execute the first interrupt signal generated by triggering the first timer until the triggering times reach the target times. The embodiment of the invention realizes the effect of the breathing lamp by utilizing the two timers of the single chip microcomputer, and the single chip microcomputer is the conventional component of the electrical equipment, so the effect of the breathing lamp is realized under the condition of not increasing the hardware cost.

Description

Breathing lamp implementation method and device, electrical equipment and storage medium
Technical Field
The embodiment of the invention relates to a household appliance control technology, in particular to a breathing lamp implementation method, a breathing lamp implementation device, electrical equipment and a storage medium.
Background
Traditional logic displays, which are single in visual effect, have not been able to adapt to ever changing product needs, and thus, have emerged as the logic for breathing lights. The present breathing lamp is mainly realized by a specially configured driving chip, such as a driving chip 3731, 3733, and the like. The breathing lamp is realized through the specially configured driving chip, and the hardware cost is higher.
Disclosure of Invention
The embodiment of the invention provides a breathing lamp implementation method, a breathing lamp implementation device, electrical equipment and a storage medium, and the effect of the breathing lamp can be achieved under the condition that the hardware cost is not increased.
In a first aspect, an embodiment of the present invention provides a breathing lamp implementation, which is applied to an electrical apparatus, where the electrical apparatus includes a single chip microcomputer and a light emitting device, the single chip microcomputer has a first timer and a second timer, and the method includes:
acquiring a first interrupt signal generated by triggering the first timer, and controlling the light-emitting device to be lightened on the basis of the first interrupt signal;
acquiring a second interrupt signal generated by triggering of the second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal;
determining whether the triggering times of the second timer reach a target number;
and when the triggering times do not reach the target times, returning to the step of acquiring the first interrupt signal generated by triggering of the first timer until the triggering times reach the target times.
Optionally, before acquiring the first interrupt signal generated by the first timer trigger, the method further includes:
setting a first trigger period for the first timer, so that the first timer triggers generation of the first interrupt signal based on the first trigger period;
setting a second trigger period for the second timer according to the first trigger period, so that the second timer triggers generation of the second interrupt signal based on the second trigger period;
wherein the second trigger period is less than the first trigger period.
Optionally, the setting a second trigger period for the second timer according to the first trigger period includes:
determining the target times;
determining a second trigger period corresponding to each trigger within the target times according to the first trigger period;
and setting a second trigger period corresponding to each trigger in the target times for the second timer.
Optionally, the determining the target number of times includes:
determining a current state of the electrical device;
determining the target number of times based on the current state.
Optionally, the determining the target number of times based on the current state includes:
if the current state is an abnormal state, determining the current abnormal level;
determining the target number of times based on the current anomaly level.
Optionally, the determining the target number of times based on the current state includes:
if the current state is a working state, determining a current working mode;
determining the target number of times based on the current operating mode.
Optionally, the duration of the second trigger period corresponding to each trigger within the target number of times is sequentially increased or sequentially decreased.
In a second aspect, an embodiment of the present invention provides a breathing lamp implementation apparatus, which is applied to an electrical device, where the electrical device includes a single chip microcomputer and a light emitting device, the single chip microcomputer has a first timer and a second timer, and the apparatus includes:
the first control module is used for acquiring a first interrupt signal generated by triggering the first timer and controlling the light-emitting device to be lightened on the basis of the first interrupt signal;
the second control module is used for acquiring a second interrupt signal generated by triggering of the second timer and controlling the light-emitting device to be turned off based on the second interrupt signal;
a determining module, configured to determine whether the number of times of triggering of the second timer reaches a target number of times;
and when the triggering times do not reach the target times, returning to the first control module to execute the step of acquiring the first interrupt signal generated by triggering the first timer until the triggering times reach the target times.
In a third aspect, an embodiment of the present invention further provides an electrical apparatus, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the program to implement the breathing lamp implementation method according to any one of the embodiments of the present invention.
In a fourth aspect, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the program, when executed by a processor, implements a breathing lamp implementation method as described in any one of the embodiments of the present invention.
In the embodiment of the invention, the electrical equipment comprises a single chip microcomputer and a light-emitting device, wherein the single chip microcomputer is provided with a first timer and a second timer, can acquire a first interrupt signal generated by triggering of the first timer, and controls the light-emitting device to be lightened on the basis of the first interrupt signal; acquiring a second interrupt signal generated by triggering of a second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal; determining whether the triggering times of the second timer reach the target times; and when the triggering times do not reach the target times, returning to the step of acquiring the first interrupt signal generated by triggering of the first timer until the triggering times reach the target times, thereby generating the effect of the breathing lamp. The embodiment of the invention realizes the effect of the breathing lamp by utilizing the two timers of the single chip microcomputer, and the single chip microcomputer is the conventional component of the electrical equipment, so the embodiment of the invention realizes the effect of the breathing lamp under the condition of not increasing the hardware cost.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic flow chart of a method for implementing a breathing lamp according to an embodiment of the present invention;
FIG. 2 is another schematic flow chart of a method for implementing a breathing lamp according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a method for determining a target number of times according to an embodiment of the present invention;
FIG. 4 is a diagram of an example of a breathing lamp implementation provided by an embodiment of the invention;
FIG. 5 is another exemplary diagram of a breathing lamp implementation provided by an embodiment of the invention;
FIG. 6 is a schematic structural diagram of a breathing lamp implementation apparatus provided in an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electrical apparatus according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Fig. 1 is a schematic flow chart of a breath lamp implementation method provided by an embodiment of the present invention, which may be implemented by a breath lamp implementation apparatus provided by an embodiment of the present invention, and the apparatus may be implemented by software and/or hardware. In a specific embodiment, the apparatus may be integrated into an electrical device, such as a washing device, a water producing device, and the like, the washing device is a washing machine, a clothes dryer, a washing and drying integrated machine, the water producing device is a water dispenser, a water purifier, a tea bar, and the like, the electrical device has a single chip microcomputer and a light emitting device, and the single chip microcomputer has a first timer and a second timer. The following embodiments will be described by taking the device integrated in an electrical apparatus as an example, and referring to fig. 1, the method may specifically include the following steps:
step 101, acquiring a first interrupt signal generated by triggering a first timer, and controlling a light-emitting device to light based on the first interrupt signal.
The single chip microcomputer is also called a single chip microcontroller, which is an integrated circuit chip, and is a small and perfect microcomputer system formed by integrating a Central Processing Unit (CPU), a Random Access Memory (RAM), a Read-Only Memory (ROM), various Input/Output (I/O) ports, interrupt systems, timers/counters and other functions (possibly including circuits such as a display driving circuit, a pulse width modulation circuit, an analog multiplexer, an a/D converter and the like) with data processing capability on a silicon chip by adopting a very large scale integrated circuit technology. The single chip microcomputer is used as a conventional component on the electrical equipment and can be generally used for realizing and controlling various functions in the electrical equipment. For example, when the electrical equipment is a washing machine, the processes of washing, dewatering and the like of the clothes can be controlled through the single chip microcomputer.
Specifically, in the embodiment of the present invention, the single chip may include at least two timers, where the at least two timers include a first timer and a second timer, and the two timers may be used to support the implementation and control of some existing functions of the electrical equipment, for example, to provide data such as timing and counting for the implementation of some existing functions. For example, when the electrical appliance is a washing machine, the timer may provide timing data for washing and dehydrating the laundry.
In the embodiment of the invention, in order to realize the function of the breathing lamp, the two existing timers can be used, and the signals generated by triggering the two timers are used for controlling the on and off of the light-emitting device. The Light Emitting device may be an indicator Light, and the indicator Light may be implemented by a Light-Emitting Diode (LED), an LED array, or the like.
And 102, acquiring a second interrupt signal generated by triggering of a second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal.
Specifically, a trigger rule may be set for each of the first timer and the second timer, and the trigger rules set for the first timer and the second timer may be the same or different, so that the two timers trigger to generate the interrupt signal according to the respective trigger rules. Illustratively, the first timer triggers to generate an interrupt signal, which may be the first interrupt signal, and the single chip microcomputer in the electrical equipment may control the light-emitting device to light up based on the first interrupt signal; the second timer triggers to generate an interrupt signal, which may be a second interrupt signal, and the single chip microcomputer in the electrical equipment may control the light-emitting device to be turned off based on the second interrupt signal.
The set trigger rule may also be referred to as a trigger rule, and the trigger rule may be set according to time. For example, the trigger rule set for the first timer may be triggered every other first duration, the trigger rule set for the second timer may be triggered every other second duration, and the first duration and the second duration may be different. In particular, since the interrupt signal generated by the second timer trigger is used to control the light emitting device to go off, i.e. the light emitting device is on during each second period, the second period may be a series of varying periods, each of which may be less than the first period, in order to achieve a better breathing effect.
103, determining whether the triggering times of the second timer reach the target times; if yes, go to step 104, otherwise go back to step 101.
In order to achieve the effect of the breathing lamp, the light emitting device needs to be turned on and off for multiple times, so that the triggering times, i.e., the target times, which at least include two times, can be set for the second timer according to actual requirements. A trigger time record may be set for the second timer, and the trigger time record may be updated after a second interrupt signal generated by triggering the second timer is acquired each time (i.e., the trigger time recorded in the trigger time record is increased by 1); after the light-emitting device is controlled to be turned off based on a second interrupt signal generated by the triggering of the second timer, whether the currently recorded triggering times in the triggering time record reach the target times or not can be judged; and if the target times are not reached, continuing to wait for the triggering of the first timer.
And step 104, ending the round.
That is, if the triggering times recorded currently in the triggering time record reach the target times, it indicates that the current round of control is finished, and the next round of triggering control may be entered or the control of the light-emitting device is finished. For example, if the current round of control is finished, and it is monitored that the user performs a corresponding operation on the electrical equipment (for example, an alarm event is released), the control of the light emitting device may be finished; if the current round of control is finished, and the situation that the user does not execute corresponding operation on the electrical equipment is monitored, the next round of trigger control can be started.
In the embodiment of the invention, the electrical equipment comprises a single chip microcomputer and a light-emitting device, wherein the single chip microcomputer is provided with a first timer and a second timer, can acquire a first interrupt signal generated by triggering of the first timer, and controls the light-emitting device to be lightened on the basis of the first interrupt signal; acquiring a second interrupt signal generated by triggering of a second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal; determining whether the triggering times of the second timer reach the target times; and when the triggering times do not reach the target times, returning to the step of acquiring the first interrupt signal generated by triggering of the first timer until the triggering times reach the target times, thereby generating the effect of the breathing lamp. The embodiment of the invention realizes the effect of the breathing lamp by utilizing the two timers of the single chip microcomputer, and the single chip microcomputer is an existing conventional component of the electrical equipment, so that the embodiment of the invention realizes the effect of the breathing lamp under the condition of not increasing the hardware cost.
The method for implementing the breathing lamp provided by the embodiment of the invention is further described below, and as shown in fig. 2, the method may include the following steps:
step 201, a first trigger cycle is set for a first timer, so that the first timer generates a first interrupt signal based on the trigger of the first trigger cycle.
Illustratively, the first trigger period may be a fixed period, and may be set according to practical situations, such as 1 millisecond (ms), 100 microseconds (μ s), and the like. Taking the first trigger period as 1ms as an example, the first timer may trigger to generate the first interrupt signal once every 1ms, where the first interrupt signal is used to control the lighting of the light emitting device.
In step 202, a target number of times is determined.
For example, the target number of times may be set according to a user operation, for example, a data input interface may be provided for a user on the electrical device, and the number of times that the user inputs on the data input interface of the electrical device is directly determined as the target number of times; or the target times can be automatically determined according to the current application scene and a preset rule. Presetting rules, for example, the more urgent the application scene is, the more the target times can be set; the more important the application scenario, the more the number of times of the target can be set; or the more dangerous the application scene is, the more the target times can be set, and the like; the more the target number is set, the more rapid the breathing effect exhibited by the light emitting device.
In particular, in the embodiment of the present invention, the target number of times may be determined in combination with the current state of the electrical apparatus, so as to prompt the user of the current state of the electrical apparatus with the breathing lamp. As shown in fig. 3, step 202 may specifically include the following steps:
step 2021, determining the current state of the electrical equipment, if the current state is abnormal, executing step 2022, and if the current state is working, executing step 2024.
The abnormal state may include a fault state, a failure state, and the like. Fault conditions such as damage to certain components, line burnout, etc.; the abnormal working state can not be realized, such as the low voltage, the unstable voltage, the uneven placement position of the electrical equipment, the untightened door of the electrical equipment and the like.
At step 2022, the current anomaly level is determined.
Specifically, various possible abnormal states may be classified in advance and an abnormal classification record may be formed, and then the abnormal classification record may be queried based on the current abnormal state to determine the current abnormal level. For example, the current abnormality level may include light abnormality, moderate abnormality, severe abnormality, and the like. For example, taking an electrical appliance as a washing machine as an example, it is possible to determine that a component is damaged, a line is burnt out, and the like as a serious abnormality, determine that a washing machine has a too low operating voltage, an unstable operating voltage, an uneven place where the washing machine is placed, and the like as a moderate abnormality, and determine that a washing machine door is not closed, and a care solution is not placed, and the like as a slight abnormality.
Step 2023, determine the target number of times based on the current anomaly level.
For example, the higher the current anomaly level, the more target times may be determined. For example, the target times corresponding to mild abnormality, moderate abnormality and severe abnormality may be increased in sequence. The level frequency corresponding relation can be preset, the level frequency corresponding relation can comprise the target frequency corresponding to each abnormal level, and the target frequency corresponding to the current abnormal level can be obtained based on the level frequency corresponding relation queried according to the current abnormal level. For example, the target frequency for a mild abnormality may be 10, and the target frequency for a severe abnormality may be 30.
At step 2024, the current operating mode is determined.
Taking an electrical appliance as an example of a washing machine, the current working mode may be a working phase of the washing machine, such as a soaking phase, a washing phase, a dewatering phase, a drying phase, and the like. Taking electrical equipment as water making equipment as an example, the current working mode can be a heating mode, a heat preservation mode, a dechlorination mode and the like.
At step 2025, a target number of times is determined based on the current operating mode.
That is, different working modes may correspond to different target times, a mode time correspondence relationship may be preset, the mode time correspondence relationship may include target times corresponding to each working mode, and the target times corresponding to the current working mode may be obtained based on the current working mode query mode time correspondence relationship. For example, the target number of times for the soaking stage may be 10 times, and the target number of times for the dehydrating stage may be 30 times.
In order to make the light emitting device exhibit a better breathing effect, in the embodiment of the present invention, the value range of the target times may be determined according to the following formula, and the target times may be set or selected within the value range.
X*X<T1
Where X represents the target number of times and T1 represents the first trigger period. For example, T1 is 1ms, i.e., T1 is 1000 μ s, then the maximum value of X may be 31, i.e., the target number may be within 31.
And step 203, determining a second trigger period corresponding to each trigger in the target times according to the first trigger period.
That is, in the embodiment of the present invention, the second trigger period is a variable period, and the duration of the second trigger period corresponding to each trigger may be different. In a specific implementation, the accumulated value of the second trigger period corresponding to each trigger may be less than or equal to the first trigger period. The duration of the second trigger period corresponding to each trigger in the target times can be sequentially increased or sequentially decreased.
For example, taking the first trigger cycle as 1000us as an example, the target number of times may be a value within 31, and if the target number of times is 10 times, the second trigger cycles corresponding to each of the 10 times may be different, the duration of the second trigger cycle corresponding to each of the 10 times may be in a sequentially increasing state or in a sequentially decreasing state, and an accumulated value of the durations of the second trigger cycles corresponding to each of the 10 times may be smaller than the first trigger cycle 1000us.
Step 204, a second trigger cycle corresponding to each trigger within the target times is set for the second timer, so that the second timer triggers and generates a second interrupt signal based on the second trigger cycle corresponding to each trigger within the target times.
Step 205, acquiring a first interrupt signal generated by triggering a first timer, and controlling the light-emitting device to light based on the first interrupt signal.
Namely, the light-emitting device can be controlled to be lightened immediately after the first interrupt signal generated by triggering the first timer is received.
And step 206, acquiring a second interrupt signal generated by triggering of a second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal.
Namely, the light-emitting device is controlled to be turned off immediately after the second interrupt signal generated by the triggering of the second timer is received. When the trigger period of the first timer is the first trigger period and the trigger period of the second timer is the second trigger period, in this process, the lighting time of the light emitting device may be understood as the second trigger period.
Step 207, determining whether the triggering frequency of the second timer reaches the target frequency, if not, returning to execute step 205, and if so, executing step 208.
It is considered that one round of the trigger control of the light emitting device is completed when the number of times of triggering of the second timer reaches the target number of times, and then the target number of first trigger periods and the target number of second trigger periods are passed through in the one round of the control. For example, if the target number is 10 times, 10 first trigger cycles and 10 second trigger cycles will be passed through in one round of control.
And step 208, finishing the round.
That is, if the triggering times recorded currently in the triggering time record reach the target times, it indicates that the current round of control is finished, and the next round of triggering control may be entered or the control of the light-emitting device is finished. For example, if the current round of control is finished, and it is monitored that the user performs a corresponding operation on the electrical equipment, the control of the light emitting device may be finished; if the current round of control is finished, and the situation that the user does not execute corresponding operation on the electrical equipment is monitored, the next round of trigger control can be started.
In the embodiment of the invention, as the second trigger period is a period with variable duration, complete control of each round is conveniently and accurately realized so as to judge whether the trigger frequency of the second timer reaches the target frequency to determine whether to finish one round of control; in practical applications, it may also be determined whether to end one round of control in other manners, for example, whether the number of times of triggering of the first timer reaches the target number of times or whether both the number of times of triggering of the first timer and the number of times of triggering of the second timer reach the target number of times is determined.
The method for implementing the breathing lamp according to the embodiment of the present invention is described in two specific examples, assuming that the first trigger period is 100 μ s, i.e. the target number of times is less than 10 times, and assuming that the target number of times is 5 times, the first trigger period and the second trigger period in one round of control may be as shown in table 1 below:
trigger period (mus) 1 st time 2 nd time 3 rd time 4 th time 5 th time
First trigger period 100μs 100μs 100μs 100μs 100μs
Second trigger period 5μs 10μs 15μs 20μs 25μs
TABLE 1
As shown in table 1, that is, the duration of the second trigger period is sequentially increased, and in one round of control, the on-off (i.e., breathing) process of the light emitting device can be as shown in fig. 4, that is, the light emitting device is turned on at 100 μ s, 205 μ s, 315 μ s, 430 μ s, 550 μ s, and turned off at 105 μ s, 215 μ s, 330 μ s, 450 μ s, 575 μ s, and it can be seen that the on-light duration of the light emitting device is sequentially increased (5 μ s, 10 μ s, 15 μ s, 20 μ s, 25 μ s).
Similarly, assuming that the first trigger period is 100 μ s, i.e. the target number is less than 10, and assuming that the target number is 5, the first trigger period and the second trigger period in one round of control can also be shown in table 2 below:
Figure BDA0003707091040000121
Figure BDA0003707091040000131
TABLE 2
As shown in table 2, that is, the duration of the second trigger period is sequentially decreased, and in one cycle of control, the on/off (i.e., breathing) process of the light emitting device can be as shown in fig. 5, that is, the light emitting device is sequentially turned on at 100 μ s, 225 μ s, 345 μ s, 460 μ s, 570 μ s, and turned off at 125 μ s, 245 μ s, 360 μ s, 470 μ s, 575 μ s, and it can be seen that the on duration of the light emitting device is sequentially decreased (25 μ s, 20 μ s, 15 μ s, 10 μ s, 5 μ s).
It should be noted that the duration, the increasing amplitude, and the decreasing amplitude shown in tables 1 and 2 are only examples, and in practical applications, the duration, the increasing amplitude, and the decreasing amplitude may be adjusted according to actual needs.
In the embodiment of the invention, the electrical equipment comprises a single chip microcomputer and a light-emitting device, wherein the single chip microcomputer is provided with a first timer and a second timer, can acquire a first interrupt signal generated by triggering of the first timer, and controls the light-emitting device to be lightened on the basis of the first interrupt signal; acquiring a second interrupt signal generated by triggering of a second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal; determining whether the triggering times of the second timer reach the target times; and when the triggering times do not reach the target times, returning to the step of acquiring the first interrupt signal generated by the triggering of the first timer until the triggering times reach the target times, thereby generating the effect of breathing the lamp. The embodiment of the invention realizes the effect of the breathing lamp by utilizing the two timers of the single chip microcomputer, and the single chip microcomputer is an existing conventional component of the electrical equipment, so that the embodiment of the invention realizes the effect of the breathing lamp under the condition of not increasing the hardware cost.
Fig. 6 is a schematic structural diagram of a breath lamp implementation apparatus provided in an embodiment of the present invention, where the apparatus is applied to an electrical device, the electrical device includes a single chip microcomputer and a light emitting device, the single chip microcomputer has a first timer and a second timer, and the apparatus is adapted to perform the breath lamp implementation method provided in the embodiment of the present invention.
As shown in fig. 6, the apparatus may specifically include:
a first control module 401, configured to acquire a first interrupt signal generated by triggering the first timer, and control the light-emitting device to light up based on the first interrupt signal;
a second control module 402, configured to obtain a second interrupt signal generated by triggering the second timer, and control the light-emitting device to turn off based on the second interrupt signal;
a determining module 403, configured to determine whether the number of times of triggering of the second timer reaches a target number of times;
and when the triggering times do not reach the target times, returning to the step of the first control module 401 to execute the step of acquiring the first interrupt signal generated by triggering the first timer until the triggering times reach the target times.
In one embodiment, the apparatus further comprises:
the first setting module is used for setting a first trigger period for the first timer so that the first timer triggers generation of the first interrupt signal based on the first trigger period;
a second setting module, configured to set a second trigger period for the second timer according to the first trigger period, so that the second timer generates the second interrupt signal based on the second trigger period;
wherein the second trigger period is less than the first trigger period.
In an embodiment, the second setting module is specifically configured to:
determining the target times;
determining a second trigger period corresponding to each trigger in the target times according to the first trigger period;
and setting a second trigger period corresponding to each trigger in the target times for the second timer.
In one embodiment, the determining the target number by the second setting module includes:
determining a current state of the electrical device;
determining the target number of times based on the current state.
In one embodiment, the second setting module determines the target number of times based on the current state, including:
if the current state is an abnormal state, determining the current abnormal level;
determining the target number of times based on the current anomaly level.
In one embodiment, the second setting module determines the target number of times based on the current state, including:
if the current state is a working state, determining a current working mode;
determining the target number of times based on the current operating mode.
In an embodiment, the duration of the second trigger period corresponding to each trigger in the target number of times is sequentially increased or sequentially decreased.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the functional module, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
The device provided by the embodiment of the invention is applied to electrical equipment comprising a single chip microcomputer and a light-emitting device, wherein the single chip microcomputer is provided with a first timer and a second timer, can acquire a first interrupt signal generated by triggering of the first timer, and controls the light-emitting device to be lightened on the basis of the first interrupt signal; acquiring a second interrupt signal generated by triggering of a second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal; determining whether the triggering times of the second timer reach the target times; and when the triggering times do not reach the target times, returning to the step of acquiring the first interrupt signal generated by the triggering of the first timer until the triggering times reach the target times, thereby generating the effect of breathing the lamp. The embodiment of the invention realizes the effect of the breathing lamp by utilizing the two timers of the single chip microcomputer, and the single chip microcomputer is the conventional component of the electrical equipment, so the embodiment of the invention realizes the effect of the breathing lamp under the condition of not increasing the hardware cost.
The embodiment of the invention also provides electrical equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the program to realize the breathing lamp realization method provided by any one of the embodiments.
Embodiments of the present invention further provide a computer-readable medium, on which a computer program is stored, where the program is executed by a processor to implement a breathing lamp implementation method provided in any one of the above embodiments.
Referring now to FIG. 7, a block diagram of a computer system 500 suitable for use with an appliance implementing an embodiment of the present invention is shown. The electric device shown in fig. 7 is only an example, and should not bring any limitation to the function and the use range of the embodiment of the present invention.
As shown in fig. 7, the computer system 500 includes a Central Processing Unit (CPU) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. A drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted on the storage section 508 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules and/or units described in the embodiments of the present invention may be implemented by software, and may also be implemented by hardware. The described modules and/or units may also be provided in a processor, which may be described as: a processor includes a first control module, a second control module, and a determination module. Wherein the names of the modules do not in some way constitute a limitation on the modules themselves.
As another aspect, the present invention also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring a first interrupt signal generated by triggering the first timer, and controlling the light-emitting device to be lightened on the basis of the first interrupt signal; acquiring a second interrupt signal generated by triggering of the second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal; determining whether the triggering times of the second timer reach a target number; and when the triggering times do not reach the target times, returning to the step of acquiring the first interrupt signal generated by triggering of the first timer until the triggering times reach the target times.
According to the technical scheme of the embodiment of the invention, the electrical equipment comprises a single chip microcomputer and a light-emitting device, wherein the single chip microcomputer is provided with a first timer and a second timer, can acquire a first interrupt signal generated by triggering of the first timer, and controls the light-emitting device to be lightened on the basis of the first interrupt signal; acquiring a second interrupt signal generated by triggering of a second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal; determining whether the triggering times of the second timer reach the target times; and when the triggering times do not reach the target times, returning to the step of acquiring the first interrupt signal generated by triggering of the first timer until the triggering times reach the target times, thereby generating the effect of the breathing lamp. The embodiment of the invention realizes the effect of the breathing lamp by utilizing the two timers of the single chip microcomputer, and the single chip microcomputer is the conventional component of the electrical equipment, so the embodiment of the invention realizes the effect of the breathing lamp under the condition of not increasing the hardware cost.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. The method for realizing the breathing lamp is characterized by being applied to electrical equipment, wherein the electrical equipment comprises a single chip microcomputer and a light-emitting device, the single chip microcomputer is provided with a first timer and a second timer, and the method comprises the following steps:
acquiring a first interrupt signal generated by triggering the first timer, and controlling the light-emitting device to be lightened on the basis of the first interrupt signal;
acquiring a second interrupt signal generated by triggering of the second timer, and controlling the light-emitting device to be turned off based on the second interrupt signal;
determining whether the triggering times of the second timer reach a target number;
and when the triggering times do not reach the target times, returning to the step of acquiring the first interrupt signal generated by triggering the first timer until the triggering times reach the target times.
2. The method of claim 1, further comprising, prior to acquiring the first interrupt signal generated by the first timer trigger:
setting a first trigger period for the first timer, so that the first timer triggers generation of the first interrupt signal based on the first trigger period;
setting a second trigger period for the second timer according to the first trigger period, so that the second timer triggers generation of the second interrupt signal based on the second trigger period;
wherein the second trigger period is less than the first trigger period.
3. The method of claim 2, wherein setting a second trigger period for the second timer according to the first trigger period comprises:
determining the target times;
determining a second trigger period corresponding to each trigger within the target times according to the first trigger period;
and setting a second trigger period corresponding to each trigger in the target times for the second timer.
4. The method of claim 3, wherein said determining said target number of times comprises:
determining a current state of the electrical device;
determining the target number of times based on the current state.
5. The method of claim 4, wherein determining the target number of times based on the current state comprises:
if the current state is an abnormal state, determining the current abnormal level;
determining the target number of times based on the current anomaly level.
6. The method of claim 4, wherein determining the target number of times based on the current state comprises:
if the current state is the working state, determining the current working mode;
determining the target number of times based on the current operating mode.
7. The method of claim 3, wherein the duration of the second trigger period for each trigger within the target number is sequentially incremented or sequentially decremented.
8. The utility model provides a breathing lamp realization device which characterized in that is applied to electrical equipment, electrical equipment includes singlechip and light emitting device, the singlechip has first timer and second timer, the device includes:
the first control module is used for acquiring a first interrupt signal generated by triggering the first timer and controlling the light-emitting device to be lightened on the basis of the first interrupt signal;
the second control module is used for acquiring a second interrupt signal generated by triggering of the second timer and controlling the light-emitting device to be turned off based on the second interrupt signal;
the determining module is used for determining whether the triggering times of the second timer reach the target times;
and when the triggering times do not reach the target times, returning to the first control module to execute the step of acquiring the first interrupt signal generated by triggering the first timer until the triggering times reach the target times.
9. An electrical device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements a breathing lamp implementation method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out a breathing lamp implementation method according to any one of claims 1 to 7.
CN202210711818.9A 2022-06-22 2022-06-22 Breathing lamp implementation method and device, electrical equipment and storage medium Pending CN115175410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210711818.9A CN115175410A (en) 2022-06-22 2022-06-22 Breathing lamp implementation method and device, electrical equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210711818.9A CN115175410A (en) 2022-06-22 2022-06-22 Breathing lamp implementation method and device, electrical equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115175410A true CN115175410A (en) 2022-10-11

Family

ID=83486465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210711818.9A Pending CN115175410A (en) 2022-06-22 2022-06-22 Breathing lamp implementation method and device, electrical equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115175410A (en)

Similar Documents

Publication Publication Date Title
CN109559934B (en) Relay drive circuit and air conditioner
CN100561395C (en) Timer construction and microcontroller and light ballast resistor with this timer construction
CN102749981B (en) Method and system for controlling hard disk electrification in hard disk array
KR960706122A (en) MICROCONTROLLER WITH MULTIPLE TIMING FUNCTIONS AVAILABLE IN A SINGLE PERIPHERAL MODULE
CN109686616B (en) Relay drive circuit and air conditioner
CN112654110B (en) Flicker control method and device of LED indicator lamp and terminal equipment
US6275948B1 (en) Processor powerdown operation using intermittent bursts of instruction clock
EP0035411A2 (en) Switching circuit for a remote control system
CN115175410A (en) Breathing lamp implementation method and device, electrical equipment and storage medium
CN109520194A (en) Frequency conversion household appliance control method, frequency conversion household electrical appliance and computer readable storage medium
CN105496331A (en) Dish washer and control method thereof
CN208462113U (en) One line light adjusting circuit, chip and system
JP6571842B2 (en) Control method of power semiconductor in inverter
US5377346A (en) Methods and apparatus for pulse-width modulation that use a counter and a modulus device
CN111779664A (en) Simulation method, device and equipment for electric automobile heat management water pump
CN111083810A (en) Power control method, device and storage medium
CN113805625B (en) Temperature control parameter determination method, temperature control method and related equipment
CN111142040B (en) Blower control method, blower control device and storage medium
CN208462114U (en) One line light adjusting circuit, chip and system
CN108882465A (en) One line light-dimming method, circuit, chip and system
CN107864414B (en) ONU customized version switching method and device, storage medium and computer equipment
WO2021021940A1 (en) Method and apparatus for automatic interleaving of cycled loads in a microgrid
US10574137B2 (en) Method for dynamically reducing peak electromagnetic interference from a group of switching devices connected on a communications bus
CN109862651A (en) One line light-dimming method, circuit, chip and system
CN218497381U (en) Control circuit and clothes treatment device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication