Microchip
直播中

李雪飞

7年用户 173经验值
私信 关注
[问答]

怎么防止键弹跳

我有按钮按压弹跳,两个按下一个释放之间。这是我压制的逻辑。我在第一次新闻上做了一件事,然后在第二次新闻发布会上做了一些事情。我有一个标志来指示我在哪一个媒体上。但是由于我得到两个按下一个按下指示,标志被清除。所以我没有第二个媒体。我正在开发一个微芯片开发工具包(PIC32 MZ DA启动工具包W/外部DDR S/多媒体扩展板(MEB)II遗产)。有什么办法来防止键弹跳或者是这个套件固有的吗?

以上来自于百度翻译


      以下为原文

    I have buttons when pressed bounce, two pressed with one release between them.  This is messing up logic I have for pressed.  I do one thing on the first press and then something on the second press.  I have a flag to indicate which press I'm on.  But since I get two presses indicated with one press, the flag is cleared.  So I don't have the second press.

I'm developing my screens on a Microchip development kit (PIC32MZ DA Starter Kit w/External DDR s/Multimedia Expansion Board (MEB) II Legacy). Is there some way to prevent the key bounce or is this inherent on this kit?

回帖(5)

夏涌革

2019-2-14 07:19:21
读取按钮状态的代码是什么?有各种各样的技术,硬件和软件,用于消除按钮。一种简单而有效的方法是在检测到第一个状态改变后延迟几个毫秒,然后再次读取以验证它是否有效。您还可以在第一次按钮按下之后的最小时间之前启用下一个新闻的检测。一篇深入深入的优秀文章:HTTP://www. GangsL.com /DeuncCnc.HTM

以上来自于百度翻译


      以下为原文

    What is your code for reading the button state? There are various techniques, both hardware and software, for debouncing pushbuttons. A fairly simple and effective method is to delay a few mSec after detection of first state change, and then read again to verify that it is valid. You can also require a minimum time after the first button press before enabling detection of the next press.
 
An excellent article that goes into great depth:
http://www.ganssle.com/debouncing.htm
举报

张静

2019-2-14 07:52:08
目标系统将考虑到触摸反弹。我只是希望能够在微芯片开发套件上摆脱它,这样当我把它移植到目标硬件上时,我就可以拥有工作代码。

以上来自于百度翻译


      以下为原文

    The target system will take into account the touch bounce.  I was just hoping to be able to get rid of it on the Microchip development kit so I can have working code when I port it over the the target hardware.
举报

杨玲

2019-2-14 08:05:02
你还没有告诉我们你现在在做什么。你在使用中断吗?轮询?如果是这样,多久一次?

以上来自于百度翻译


      以下为原文

    You still haven't told us what you're currently doing.  Are you using interrupts? Polling?  If so, how often?
举报

王焕树

2019-2-14 08:15:59
在你的最后一个帖子中,你指的是触摸。你在用触摸屏吗?它是电阻式触摸吗?如果是这样,检查多线程的触摸问题与H2.03B。

以上来自于百度翻译


      以下为原文

    In your last post you indicated touch.
Are you using a touch screen?
Is it resistive touch?
If so check the multiple threads on touch issues with H2.03B.
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分