使用C ++处理GPIO按钮事件 [英] Handle GPIO Button event with C++

查看:122
本文介绍了使用C ++处理GPIO按钮事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助.我正在ARM中制作一个c ++嵌入式应用程序.我需要获得一个按钮事件,我正在互联网上寻找,发现最好的方法是打断时间.我知道我可以通过终端设置一个针脚,例如回声升高>/sys/.../gpio/gpio81/edge".但是我需要知道如何在发生问题时从C ++应用程序中获取中断,我只需要一些示例,因为我不知道是否必须使用一些特殊的库.

Hi guys I need some help. I am making a c++ embedded application in an ARM. I need to get a push button event, I was looking for in internet and I find that the best way to do it is with interruptions. I know that I can set one pin through terminal like this "echo raise > /sys/.../gpio/gpio81/edge". But I need to know how can I get the interrupt from my C++ application when it happend, I just need some example, because I do not know if I have to use some special library.

谢谢你们,我希望有人能帮助我.

Thank you guys I hope someone can help me.

推荐答案

大家好,我在这里找到了我想要的解决方案:

Hi guys I find the solution what I just wanted is here:

https://developer.ridgerun.com/wiki/index.php/Gpio-int-test.c

还是谢谢你

这篇关于使用C ++处理GPIO按钮事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆