CN111857305A - Self-reset key state switching method - Google Patents
Self-reset key state switching method Download PDFInfo
- Publication number
- CN111857305A CN111857305A CN202010748714.6A CN202010748714A CN111857305A CN 111857305 A CN111857305 A CN 111857305A CN 202010748714 A CN202010748714 A CN 202010748714A CN 111857305 A CN111857305 A CN 111857305A
- Authority
- CN
- China
- Prior art keywords
- state
- key
- self
- signal
- switched
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 230000000630 rising effect Effects 0.000 claims abstract description 19
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/24—Resetting means
-
- H—ELECTRICITY
- H01—ELECTRIC ELEMENTS
- H01H—ELECTRIC SWITCHES; RELAYS; SELECTORS; EMERGENCY PROTECTIVE DEVICES
- H01H13/00—Switches having rectilinearly-movable operating part or parts adapted for pushing or pulling in one direction only, e.g. push-button switch
- H01H13/50—Switches having rectilinearly-movable operating part or parts adapted for pushing or pulling in one direction only, e.g. push-button switch having a single operating member
- H01H13/56—Switches having rectilinearly-movable operating part or parts adapted for pushing or pulling in one direction only, e.g. push-button switch having a single operating member the contact returning to its original state upon the next application of operating force
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K17/00—Electronic switching or gating, i.e. not by contact-making and –breaking
- H03K17/94—Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated
- H03K17/96—Touch switches
- H03K17/964—Piezoelectric touch switches
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Lock And Its Accessories (AREA)
Abstract
The invention discloses a self-reset key state switching method, which collects self-reset key signals, judges the collected key pressing or releasing signals, judges according to the high/low level of the signals, the parity of the high/low level change times or the rising/falling edge of the signals and determines whether the key states are switched. The invention discloses a method for realizing state switching of a self-locking key by using a self-resetting key, which can realize that the key is released into one state after being pressed once and is released into another state after being pressed once by using the self-resetting key, thereby solving the use requirement of realizing the state switching function of the self-locking key under the condition of no self-locking key.
Description
Technical Field
The invention relates to a switching method of a key switch, in particular to a method for realizing self-locking key state switching by adopting a self-resetting key.
Background
The self-reset key is a key which switches the switch state when the key is pressed and returns to the original switch state when the key is released. This is often the case: the button is released into one state after being pressed once, and is released into another state after being pressed once again, and the self-locking type button is a common solution in the situation. However, in special situations, if the hardware condition does not have the self-locking key, and only the self-resetting key exists, there is no way to implement the state switching function of the self-locking key, in which the key is released into one state after being pressed once and then released into another state after being pressed once again. The scheme is realized under the condition of using the self-reset key, and provides a method for replacing the self-locking key by the self-reset key.
Disclosure of Invention
The technical problem to be solved by the invention is to overcome the defects of the prior art, and provide a method for switching the state of a self-locking key by using a self-resetting key, so that the use requirement of realizing the state switching function of the self-locking key under the condition of no self-locking key is met.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a self-reset key state switching method collects self-reset key signals, judges the collected key pressing or releasing signals, and determines whether the key states are switched according to the high/low level of the signals.
Furthermore, when the pressing signal of the key is at a high level and the release reset signal is at a low level, the state of the key is switched from the original first state to the second state; otherwise, keeping the original state;
in the second state, when the re-pressing signal of the key is at a high level and the release reset signal is at a low level, the key state is switched from the second state to the first state; otherwise, the state is kept in the second state.
Furthermore, when the pressing signal of the key is at a low level and the release reset signal is at a high level, the state of the key is switched from the original first state to the second state; otherwise, keeping the original state;
in the second state, when the re-pressing signal of the key is at low level and the loosening reset signal is at high level, the key state is switched from the second state to the first state; otherwise, the state is kept in the second state.
Furthermore, the collected self-reset key signals are accessed into the controller, and the controller judges the read key signals.
A self-reset key state switching method collects self-reset key signals, judges the parity of the high/low level change times of the collected key signals and determines whether the key states are switched or not.
Furthermore, when each pressing signal of the key is in a high level, the first counter is increased by 1, and when the count of the first counter is an odd number or an even number, the first counter is switched to a first state; when the count of the first counter is even or odd, the first counter is switched to a second state.
Furthermore, when each pressing signal of the key is in a low level, the first counter is increased by 1, and when the count of the first counter is an odd number or an even number, the first counter is switched to a first state; when the count of the first counter is even or odd, the first counter is switched to a second state.
Furthermore, the collected self-reset key signals are accessed into the controller, and the controller judges the read key signals.
A self-reset key state switching method collects self-reset key signals, judges the collected key signals, judges according to the rising edge and the falling edge of the signals, and determines whether the key states are switched or not.
Furthermore, the pressing signal of the key is a rising edge, and when the releasing reset signal is a falling edge, the state of the key is switched from the original first state to the second state; otherwise, keeping the original state;
in the second state, when the re-pressing signal of the key is a rising edge and the loosening reset signal is a falling edge, the key state is switched from the second state to the first state; otherwise, the state is kept in the second state.
Furthermore, the pressing signal of the key is a falling edge, and when the releasing reset signal is a rising edge, the state of the key is switched from the original first state to the second state; otherwise, keeping the original state;
in the second state, when the re-pressing signal of the key is a falling edge and the loosening reset signal is a rising edge, the key state is switched from the second state to the first state; otherwise, the state is kept in the second state.
And accessing the acquired self-reset key signal into the controller, and judging the read key signal by the controller.
The invention achieves the following beneficial effects:
the invention discloses a method for realizing state switching of a self-locking key by using a self-resetting key, which can realize that the key is released into one state after being pressed once and is released into another state after being pressed once by using the self-resetting key, thereby solving the use requirement of realizing the state switching function of the self-locking key under the condition of no self-locking key.
Drawings
FIG. 1 is a flow chart of a self-resetting key state switching method according to embodiment 1;
FIG. 2 is a flow chart of a self-resetting key state switching method according to embodiment 2;
fig. 3 is a flow chart of a self-reset key state switching method according to embodiment 3.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
Example 1
Referring to fig. 1, a self-reset key signal is collected, the collected key signal is judged, and whether the key state is switched is determined according to the high/low level of the signal.
When the high level signal is taken as the judgment basis, the pressing signal of the key is at the high level, and when the release reset signal is at the low level, the state of the key is switched from the original first state (or second state) to the second state (or first state); otherwise, the original state is kept. When the second state (or the first state) is adopted, the key state is switched from the second state (or the first state) to the first state (or the second state) when the re-pressing signal of the key is at a high level and the release reset signal is at a low level; otherwise, the second state (or the first state) is maintained. The switching between the two states is realized by adopting the self-reset key to replace the self-locking key repeatedly.
Or the low level signal is taken as the judgment basis, when the pressing signal of the key is at the low level and the release reset signal is at the high level, the state of the key is switched from the original first state (or second state) to the second state (or first state); otherwise, the original state is kept. When the second state (or the first state) is adopted, the key state is switched from the second state (or the first state) to the first state (or the second state) when the re-pressing signal of the key is at the low level and the release reset signal is at the high level; otherwise, the second state (or the first state) is maintained. The switching between the two states is realized by adopting the self-reset key to replace the self-locking key repeatedly.
In this embodiment, the collected self-reset key signal may be accessed to the controller, and the controller may determine the high/low level of the read key signal.
In other embodiments, other means may be used in place of the controller.
Example 2
Referring to fig. 2, the self-reset key signal is collected, the collected key signal is judged, and the judgment is performed according to the parity of the number of changes of the signal to determine whether the key state is switched.
When the change times of the high-level signal is taken as a judgment basis, the first counter is increased by 1 when each time the signal of the key is pressed is at a high level, and when the count of the first counter is an odd number (or an even number), the first counter is switched to a first state; when the count of the first counter is even (or odd), the first counter is switched to the second state. The switching between the two states is realized by adopting the self-reset key to replace the self-locking key repeatedly.
Or the change of the low level signal is taken as the judgment basis, when the signal pressed each time by the key is at the low level, the first counter is added with 1, and when the count of the first counter is an odd number (or an even number), the first counter is switched to the first state; when the count of the first counter is even (or odd), the first counter is switched to the second state. The switching between the two states is realized by adopting the self-reset key to replace the self-locking key repeatedly.
In this embodiment, the collected self-reset key signal may be accessed to the controller, the controller may count the number of times of change of the read key signal, and determine whether to switch the key state according to the parity of the counted number of times of change.
In other embodiments, other means may be used in place of the controller.
Example 3
Referring to fig. 3, the self-reset key signal is collected, the collected key signal is judged, and the judgment is performed according to the rising edge and the falling edge of the signal to determine whether the key state is switched.
When the rising edge of the signal is taken as a judgment basis, the pressing signal of the key is taken as the rising edge, and when the loosening reset signal is taken as the falling edge, the state of the key is switched from the original first state (or second state) to the second state (or first state); otherwise, the original state is kept. When the second state (or the first state) is adopted, the key state is switched from the second state (or the first state) to the first state (or the second state) when the re-pressing signal of the key is a rising edge and the release reset signal is a falling edge; otherwise, the second state (or the first state) is maintained. The switching between the two states is realized by adopting the self-reset key to replace the self-locking key repeatedly.
Or the falling edge of the signal is taken as the judgment basis, the pressing signal of the key is taken as the falling edge, and when the release reset signal is taken as the rising edge, the state of the key is switched from the original first state (or second state) to the second state (or first state); otherwise, the original state is kept. When the second state (or the first state) is adopted, the key state is switched from the second state (or the first state) to the first state (or the second state) when the re-pressing signal of the key is a falling edge and the releasing reset signal is a rising edge; otherwise, the second state (or the first state) is maintained. The switching between the two states is realized by adopting the self-reset key to replace the self-locking key repeatedly.
In this embodiment, the collected self-reset key signal may be accessed to the controller, and the controller processes the rising edge or the falling edge of the read key signal, and determines whether the key state is switched according to the rising edge or the falling edge signal.
In other embodiments, other means may be used in place of the controller.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.
Claims (9)
1. A self-reset key state switching method is characterized in that a self-reset key signal is collected, the collected key pressing or releasing signal is judged, and whether the key state is switched or not is determined according to the high/low level of the signal.
2. The method of claim 1, wherein when the key is pressed at a high level and the release reset signal is at a low level, the key state is switched from the original first state to the second state; otherwise, keeping the original state;
in the second state, when the re-pressing signal of the key is at a high level and the release reset signal is at a low level, the key state is switched from the second state to the first state; otherwise, the state is kept in the second state.
3. The method of claim 1, wherein when the key is pressed at a low level and the release reset signal is at a high level, the key state is switched from the original first state to the second state; otherwise, keeping the original state;
in the second state, when the re-pressing signal of the key is at low level and the loosening reset signal is at high level, the key state is switched from the second state to the first state; otherwise, the state is kept in the second state.
4. A self-reset key state switching method is characterized in that a self-reset key signal is collected, the parity of the high/low level change times of the collected key signal is judged, and whether the key state is switched or not is determined.
5. The method as claimed in claim 4, wherein the first counter is incremented by 1 when each key-press signal is high, and the first counter is switched to the first state when the count of the first counter is odd or even; when the count of the first counter is even or odd, the first counter is switched to a second state.
6. The method as claimed in claim 4, wherein the first counter is incremented by 1 when each key pressing signal is low, and the first counter is switched to the first state when the count of the first counter is odd or even; when the count of the first counter is even or odd, the first counter is switched to a second state.
7. A self-reset key state switching method is characterized in that self-reset key signals are collected, the collected key signals are judged, judgment is carried out according to the rising edge and the falling edge of the signals, and whether the key states are switched or not is determined.
8. The self-reset key state switching method according to claim 7,
the pressing signal of the key is a rising edge, and when the releasing reset signal is a falling edge, the state of the key is switched from the original first state to the second state; otherwise, keeping the original state;
in the second state, when the re-pressing signal of the key is a rising edge and the loosening reset signal is a falling edge, the key state is switched from the second state to the first state; otherwise, the state is kept in the second state.
9. The self-reset key state switching method according to claim 7,
the pressing signal of the key is a falling edge, and when the releasing reset signal is a rising edge, the state of the key is switched from the original first state to the second state; otherwise, keeping the original state;
in the second state, when the re-pressing signal of the key is a falling edge and the loosening reset signal is a rising edge, the key state is switched from the second state to the first state; otherwise, the state is kept in the second state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010748714.6A CN111857305B (en) | 2020-07-30 | 2020-07-30 | Self-reset key state switching method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010748714.6A CN111857305B (en) | 2020-07-30 | 2020-07-30 | Self-reset key state switching method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111857305A true CN111857305A (en) | 2020-10-30 |
CN111857305B CN111857305B (en) | 2021-11-26 |
Family
ID=72946307
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010748714.6A Active CN111857305B (en) | 2020-07-30 | 2020-07-30 | Self-reset key state switching method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111857305B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101206531A (en) * | 2006-12-18 | 2008-06-25 | 汉王科技股份有限公司 | Coordinate position indicator with press keys |
US20140313358A1 (en) * | 2013-04-18 | 2014-10-23 | Looq System Inc | Peripheral equipment for controlling camera arranged in a terminal, system and method thereof |
CN208112623U (en) * | 2018-04-28 | 2018-11-16 | 刘航麟 | A kind of fixed phonetic controller of communication apparatus |
CN110602308A (en) * | 2019-07-30 | 2019-12-20 | 努比亚技术有限公司 | Display screen control method and device |
CN210326340U (en) * | 2019-05-09 | 2020-04-14 | 突破电气(天津)有限公司 | Self-resetting anti-loose socket and PDU |
CN210839530U (en) * | 2019-11-20 | 2020-06-23 | 宁波柯力传感科技股份有限公司 | Self-locking switch circuit adopting NOR gate and MOS (metal oxide semiconductor) tube |
CN111427279A (en) * | 2020-02-25 | 2020-07-17 | 江苏亨通问天量子信息研究院有限公司 | Software self-locking type key on-off control system and method |
-
2020
- 2020-07-30 CN CN202010748714.6A patent/CN111857305B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101206531A (en) * | 2006-12-18 | 2008-06-25 | 汉王科技股份有限公司 | Coordinate position indicator with press keys |
US20140313358A1 (en) * | 2013-04-18 | 2014-10-23 | Looq System Inc | Peripheral equipment for controlling camera arranged in a terminal, system and method thereof |
CN208112623U (en) * | 2018-04-28 | 2018-11-16 | 刘航麟 | A kind of fixed phonetic controller of communication apparatus |
CN210326340U (en) * | 2019-05-09 | 2020-04-14 | 突破电气(天津)有限公司 | Self-resetting anti-loose socket and PDU |
CN110602308A (en) * | 2019-07-30 | 2019-12-20 | 努比亚技术有限公司 | Display screen control method and device |
CN210839530U (en) * | 2019-11-20 | 2020-06-23 | 宁波柯力传感科技股份有限公司 | Self-locking switch circuit adopting NOR gate and MOS (metal oxide semiconductor) tube |
CN111427279A (en) * | 2020-02-25 | 2020-07-17 | 江苏亨通问天量子信息研究院有限公司 | Software self-locking type key on-off control system and method |
Non-Patent Citations (1)
Title |
---|
张开宇等: "基于IAP15F2K61S2的门禁控制系统的设计与实现", 《技术与应用》 * |
Also Published As
Publication number | Publication date |
---|---|
CN111857305B (en) | 2021-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8558579B2 (en) | Digital glitch filter | |
CN101036413B (en) | High-resolution timer-efficient sliding window | |
US8502593B2 (en) | Balanced debounce circuit with noise filter for digital system | |
CN107589933B (en) | Knob type digital coding switch device and working state identification method thereof | |
EP2109872A2 (en) | Recording device for recording the switch state of an electromagnetic switch device | |
RU52287U1 (en) | MAJORITY ELEMENT "THREE OF FIVE" | |
CN111857305B (en) | Self-reset key state switching method | |
JPS60181815A (en) | Capacitive keyboard | |
CN101222222A (en) | Signal cleaning circuit | |
CN104101831A (en) | Relay failure detection system | |
US6377108B1 (en) | Low jitter differential amplifier with negative hysteresis | |
US3226493A (en) | Push button control unit | |
CN110471467B (en) | Intelligent temperature protection method and system | |
CN110852903B (en) | Ladder type elastic network storm filtering method based on FPGA | |
JP2002537547A (en) | Comparator circuit | |
US11422189B2 (en) | Switch and abnormality determining method thereof | |
CN108063601B (en) | Automatic gain control circuit and signal processing system | |
US6982389B2 (en) | Decoupled pushbuttons | |
JP4696202B2 (en) | Adaptive slicer threshold generation method and system | |
CN217116515U (en) | Carbon film structure for printed circuit board | |
JP4151182B2 (en) | Input control device | |
CN208285294U (en) | Driving switch and electric vehicle | |
CN100463087C (en) | Method for generating plug-out signal in advance for hot-plug-out board | |
CN219653830U (en) | Shortcut key assembly and intelligent toilet | |
EP0171761A3 (en) | Circuit arrangement for telecommunication installations, especially for telephone exchanges comprising information processors and traffic load counters |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |