CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - delay jitter
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - delay jitter - List
[
SCM
]
bianmakaiguan
DL : 0
本代码为编码开关代码,编码开关也就是数字音响中的 360度旋转的数字音量以及显示器上用的(单键飞梭开 关)等类似鼠标滚轮的手动计数输入设备。 我使用的编码开关为5个引脚的,其中2个引脚为按下 转轮开关(也就相当于鼠标中键)。另外3个引脚用来 检测旋转方向以及旋转步数的检测端。引脚分别为a,b,c b接地a,c分别接到P2.0和P2.1口并分别接两个10K上拉 电阻,并且a,c需要分别对地接一个104的电容,否则 因为编码开关的触点抖动会引起轻微误动作。本程序不 使用定时器,不占用中断,不使用延时代码,并对每个 细分步数进行判断,避免一切误动作,性能超级稳定。 我使用的编码器是APLS的EC11B可以参照附件的时序图 编码器控制流水灯最能说明问题,下面是以一段流水 灯来演示。-Code for encoding the switch code, coding switch is in the digital audio The number of 360-degree rotating display with the volume, as well as the (one-touch open Shuttle Clearance) and similar to manually count the mouse wheel input device. I use the code switch for the 5-pin, 2 pin for which the press Rotary switch (it is equivalent to middle mouse button). In addition to 3-pin Detection of rotation direction and rotation end detection step. Pin, respectively, for a, b, c b grounding a, c, respectively, from P2.0 and P2.1, respectively, then the mouth and pull the two 10K Resistance, and a, c, respectively, of the need to take a capacitance 104, or Because the coding of the contact switch will cause a slight jitter malfunction. This procedure does not The use of timers, interrupt off, do not use delay code, and each Determine the number of sub-step, to avoid all the wrong moves, super stable performance. I use the encoder is the APLS can refer to the annex EC11B
Date
: 2026-01-09
Size
: 788kb
User
:
李波
[
SCM
]
key
DL : 0
单片机按键去抖动,不同于书上解释的延时去抖,程序比较有启发意义-Single-chip key to jitter, the interpretation is different from the book go to stir up delay, the more instructive
Date
: 2026-01-09
Size
: 1kb
User
:
li
[
SCM
]
keydrive
DL : 0
一个显示0到f的4*4 key 驱动程序,里面包含了延时去抖动,调用子函数,行列值的计算-A display from 0 to f, 4* 4 key drivers, which contains a delay to the jitter, call the Functions, the ranks of calculation
Date
: 2026-01-09
Size
: 1kb
User
:
dahai
[
SCM
]
pic18f66j60_C_receiving
DL : 0
建立环状队列保存过去10个键盘状态,利用天然获得的时延,消键抖,防止连续动作,选择响应模式(下键或抬键动作)。还可以防止两键同按引起的误动作,这里主要靠键值识别,两键同下的键值与单键下键的值不同,拒绝之即可。-Create circular queue holds the state over the past 10 steps of the keyboard, using natural available delay, jitter elimination keys, to prevent the continuous action, select the response mode (the key or lift button action). You can also prevent the two key malfunction caused by the same, this is mainly identified by the key, two keys with one-touch keys with the following value under the key difference, the refusal can be.
Date
: 2026-01-09
Size
: 2kb
User
:
zhao
[
SCM
]
jianpan24
DL : 0
24键键盘程序,引脚说明及连线 列线:p4.0 p4.1 p4.2 p4.3 作为输入 行线:p4.4 p4.5 p4.6 p4.7 p6.5 p6.6作为输出 1、检测当前是否有键被按下。检测的方法是P4.4-P4.7,P6.5,P6.6输出全"0",读取P4.0-P4.3的状态,若P4.0-P4.3为全"1",则无键闭合,否则有键闭合。 2、去除键抖动。当检测到有键按下后,延时一段时间再做下一步的检测判断。 3、若有键被按下,应识别出是哪一个键闭合。方法是对键盘的行线进行扫描。P4.4-P4.7,P6.5,P6.6按下述6种组合依次输出: P6.6 111110 P6.5 111101 P4.7 111011 P4.6 110111 P4.5 101111 P4.4 011111 在每组行输出时读取P4.0-P4.3,若全为"1",则表示为"0"这一行没有键闭合,否则有键闭合。 由此得到闭合键的行值和列值,然后可采用计算法或查表法将闭合键的行值和列值转换成所定义的键值。 4、为了保证键每闭合一次CPU仅作一次处理,必须去除键释放时的抖动。- 24-key keyboard program, Pin description and connection Column line: p4.0 p4.1 p4.2 p4.3 as input Line line: p4.4 p4.5 p4.6 p4.7 p6.5 p6.6 as output 1, testing whether the current key is pressed. Detection method is to P4.4-P4.7, P6.5, P6.6 output all "0", read the state of P4.0-P4.3, P4.0-P4.3 as if all "1" , no key closure, or a button closure. 2, remove the key jitter. When a key is detected, the delay time to do some testing to determine the next step. 3, if a key is pressed, which should identify a key closed. The line is the keyboard scan lines. P4.4-P4.7, P6.5, P6.6 followed by combination of the following six kinds of output: P6.6 111110 P6.5 111101 P4.7 111011 P4.6 110111 P4.5 101111 P4.4 011111 To read each line of output, P4.0-P4.3, if all is "1", then "0" key to this line is not closed, or have key closed. The resultant closure of the row and column key value, and then calculation or look-up table can be closed keys to row and column values into a
Date
: 2026-01-09
Size
: 2kb
User
:
赵盈盈
[
SCM
]
keyscan
DL : 0
最基础的一个51单片机键盘检测函数,带有延时去抖动功能-The most basic function of a 51 Keyboard for testing, with the delay to the jitter
Date
: 2026-01-09
Size
: 1kb
User
:
区家兴
[
SCM
]
CodeSwitch-
DL : 0
本代码为编码开关代码,编码开关也就是数字音响中的 360度旋转的数字音量以及显示器上用的(单键飞梭开 关)等类似鼠标滚轮的手动计数输入设备。 我使用的编码开关为5个引脚的,其中2个引脚为按下 转轮开关(也就相当于鼠标中键)。另外3个引脚用来 检测旋转方向以及旋转步数的检测端。引脚分别为a,b,c b接地a,c分别接到P2.0和P2.1口并分别接两个10K上拉 电阻,并且a,c需要分别对地接一个104的电容,否则 因为编码开关的触点抖动会引起轻微误动作。本程序不 使用定时器,不占用中断,不使用延时代码,并对每个 细分步数进行判断,避免一切误动作,性能超级稳定。 我使用的编码器是APLS的EC11B可以参照附件的时序图 编码器控制流水灯最能说明问题,下面是以一段流水 灯来演示。-This code for code switch code, coding switch is the digital audio 360 degrees of rotation digital volume and displays use on the open list key shuttle ( Closed) and similar mouse wheel manual count input device. I use a code switch for five of the pins, with two pins for press The runner switch (also is equivalent to the middle mouse button). Three other pins are used to The rotation direction detection and rotation of the number of detection. Pins are respectively for a, b, c B, c received a ground respectively P2.0 and P2.1 mouth and take two 10 K respectively on pull Resistance, and a, c need to pick up a respectively in 104, otherwise the capacitance Because of the code switch contacts jitter can cause minor wrong action. This procedure does not Use timer, do not take up interrupt, do not use delay, and each code Segment for judgment, avoid steps all misoperation, super stable performance. I use of APLS is encoder EC11B can refer to the attachment sequence chart Encode
Date
: 2026-01-09
Size
: 805kb
User
:
赵博伟
[
SCM
]
KEY
DL : 0
ATMEGA16检测按键的程序,去抖动延时-ATMEGA16 detection key procedures, de-jitter delay
Date
: 2026-01-09
Size
: 53kb
User
:
regerg
[
SCM
]
zhong-duan-ji-shu-LED-blink
DL : 0
上一节讲了多任务中蜂鸣器驱动程序的框架,这节继续利用多任务处理的方式,在主函数中利用累计主循环次数来实现独立按键的检测。要教会大家四个知识点: 第一点:独立按键的驱动程序框架 第二点:用累计主循环次数来实现去抖动的延时。 第三点:灵活运用防止按键不松手后一直触发的按键自锁标志。 第四点:在按键去抖动延时计时中,添加一个抗干扰的软件监控判断。一旦发现瞬间杂波干扰,马上把延时计数器清零。 这种方法是我在复杂的工控项目中总结出来的。以后凡是用到开关感应器的地方,都可以用类似的方法实现软件上的抗干扰处理。 具体内容,请看源代码讲解。 (1)用矩阵键盘中的S1和S5号键作为独立按键,记得把输出线P0.4一直输出低电平,模拟独立按键的触发地GND。 (2)实现功能:有两个独立按键,每按一个独立按键,蜂鸣器发出“滴”的一声后就停。-Previous section talked about the framework of multi-tasking in buzzer driver, this section continue to use the way multi-task processing, are used to detect the use of separate keys cumulative primary cycles in the main function. Knowledge to teach you four points: First point: independent key driver framework The second point: The cumulative number of cycles to achieve the main debounce delay. The third point: flexible use grimdeath prevent the keys from the lock button has been triggered flag. The fourth point: the key to timing jitter delay, add an anti-jamming software monitoring judgments. Once an instant clutter found immediately to the delay counter is cleared. This approach is summed up in my complex industrial projects. After all switch sensors used in place anti-jamming processing software can be achieved on a similar approach. Details, see the source code to explain. (1) with S1 and S5 matrix keypad number keys as a separate button, remember to out
Date
: 2026-01-09
Size
: 3kb
User
:
高飞
[
SCM
]
main-li-zhong-duan-jishu-
DL : 0
上一节讲了多任务中蜂鸣器驱动程序的框架,这节继续利用多任务处理的方式,在主函数中利用累计主循环次数来实现独立按键的检测。要教会大家四个知识点: 第一点:独立按键的驱动程序框架 第二点:用累计主循环次数来实现去抖动的延时。 第三点:灵活运用防止按键不松手后一直触发的按键自锁标志。 第四点:在按键去抖动延时计时中,添加一个抗干扰的软件监控判断。一旦发现瞬间杂波干扰,马上把延时计数器清零。 这种方法是我在复杂的工控项目中总结出来的。以后凡是用到开关感应器的地方,都可以用类似的方法实现软件上的抗干扰处理。 具体内容,请看源代码讲解。 记得把输出线P0.4一直输出低电平,模拟独立按键的触发地GND。 实现功能:有两个独立按键,每按一个独立按键,蜂鸣器发出“滴”的一声后就停。-Previous section talked about the framework of multi-tasking in buzzer driver, this section continue to use the way multi-task processing, are used to detect the use of separate keys cumulative primary cycles in the main function. Knowledge to teach you four points: First point: independent key driver framework The second point: The cumulative number of cycles to achieve the main debounce delay. The third point: flexible use grimdeath prevent the keys from the lock button has been triggered flag. The fourth point: the key to timing jitter delay, add an anti-jamming software monitoring judgments. Once an instant clutter found immediately to the delay counter is cleared. This approach is summed up in my complex industrial projects. After all switch sensors used in place anti-jamming processing software can be achieved on a similar approach. Details, see the source code to explain. I remember the output lines P0.4 output has been low, the analog trigger buttons i
Date
: 2026-01-09
Size
: 3kb
User
:
高飞
[
SCM
]
STC12C5A60S2_KEY
DL : 0
单个按键扫描程序 1、程序说明: 该例程演示了接在单片机P1端口上的五个按键。 通过程序扫描对应按键端口的电平状态来确定是否该键按下, 通过机械按键按下和松开时有抖动现象,需在程序中适当延时消除抖动, 避免识别到错误信息,该程序同时具有等待按键释放的功能。 2、实验操作 将拨码开关S10的SMG端拨到ON端,表示该端接通。 同时把该拨码开关的其他端置为断开状态,即不拨到ON端。 否则将影响到实验效果。将程序下载到开发板中运行后, 依次按下S2到S6任意一个键,将在数码管上显示相应的键值-Single key scanner 1, program instructions: This routine demonstrates the five buttons connected to the P1 port on the microcontroller. Determines whether the key is pressed by the program scan corresponding to the level state of the key port, By mechanical press and release the button when the jitter phenomenon, the need for appropriate delay in the process of eliminating jitter, Avoid identifying the error message, and the program has the function of waiting for the release of the key. 2, experimental operation The dial switch SMG S10 end of the ON to the side, indicating that the end is connected. At the same time, the other end of the dial switch is in a disconnected state, that is, the switch is not transferred to the ON terminal. Otherwise, it will affect the experimental results. After the program is downloaded to the development board to run, In order to press S2 to S6 any key, the corresponding key will display in the digital tube
Date
: 2026-01-09
Size
: 38kb
User
:
yushizhen
[
SCM
]
key
DL : 0
51单片机新型按键扫描,不用10ms延时消抖,实时性大大提高。每个按键有长按短按功能,采用结构体对象化编程,增加按键极度方便。(The new key scan does not use 10ms delay to eliminate jitter, and the real-time performance is greatly improved. Each button has a long press, a short press function, the use of structured object programming, increasing the key, extremely convenient.)
Date
: 2026-01-09
Size
: 3kb
User
:
沧海一瞬
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.