完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我想得到一个应用程序的信息。我推了CasSob按钮,例如WorkWork。如果我按更长的按钮,另一个马达工作。例如计数器。当我按下按钮一次,增加计数器一次,按住同一个按钮按钮计数器增加几十。我应该如何用程序做这个。谢谢。 以上来自于百度翻译 以下为原文 Hi, I want to get information for an application.I pushed capsense button, for example works motor. If I press the even longer same button works another motor. For example counter. When I pressed button for once, increase counter once, ı hold down same capsense button counter increase in tens. How should I do this with program. Thanks. |
|
相关推荐
2个回答
|
|
基本上,你实现了一个时间计数器或一个连接到ISR的时钟。到
区分你按住按钮的时间,并根据时间 实现不同的功能,比如启动备用电机。 所以创建一个计时器,比如说100毫秒,启用它的中断,每次ISR。 火灾公司时间计数器。然后在主()中测试计数器并基于其 价值行动不同的任务。当您释放时,清除时间计数器。 问候,Dana。 以上来自于百度翻译 以下为原文 Basically you implement a time counter or a clock connected to an ISR. To differentiate how long you hold a button down, and based on time held implement different functions, like starting the alternate motor. So create a timer, say 100 mS, enable its interrupt, and each time ISR fires inc a time counter. Then in main() test the counter and based on its value action different tasks. When released you clear the time counter. Regards, Dana. |
|
|
|
用于控制电机:
你可以为此使用计时器。 当检测到按钮按压时,启动计时器。当按钮被释放时,停止计时器。 读取定时器值。 如果它超过一个阈值(由你选择,比如说2秒),则启动MaTe2。否则启动电机1。 当做。 以上来自于百度翻译 以下为原文 For controlling motors :-- You can use a timer for this. As a button press is detected, start the timer . And as the button is released, stop the timer. Read the timer value. If it is more than a threshold value [selected by you, say 2 seconds] then motor2 is started. Else motor1 is started. Regards. |
|
|
|
只有小组成员才能发言,加入小组>>
760个成员聚集在这个小组
加入小组2151 浏览 1 评论
1897 浏览 1 评论
3718 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1829 浏览 6 评论
1574 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
778浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
536浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
482浏览 2评论
443浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
1139浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-2-24 18:12 , Processed in 0.777303 second(s), Total 46, Slave 41 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191