从Arduino发送数据和事件到手机
我是新手,之前没有 arduino 或微控制器编程经验。对于我的一个课程项目,我需要通过蓝牙将数据/消息/事件从arduino发送到我的手机(比如android),因为arduino板将有一个外部按钮/开关,按下该按钮/开关时应将事件发送到我的手机Android 手机上的应用程序。
我做了一些谷歌搜索,发现 Arduino BT 和 amarino 作为我的项目的正确选择。然后还有 BTShield v1.1,这是一个便宜的替代方案(但我不确定接口)。话虽如此,任何人都可以给我一些关于蓝牙编程部分和蓝牙编程的指导吗?有关如何执行此操作的一些示例代码。另外,是否可以在 arduino 板上嵌入按钮/开关之类的东西以及 as & ?当按下时,我的 Android 应用程序是否可以检测到该按下事件?
任何帮助将不胜感激。
谢谢。
I'm a newbie and have no prior experience with arduino or microcontroller programming. For one of my course project, i need to send data/message/event from the arduino to my mobile phone (say android) via bluetooth as in the arduino board will have an external button/switch which when pressed should send an event to my application on android phone.
I did some googling and found Arduino BT and amarino as the right option for my project. And then there is BTShield v1.1 which is a cheap alternative (but i'm not sure about the interfacing). having said that, can anyone plz give me some pointers on the bluetooth programming part & some example codes on how to do this. Also, is it possible to embed a button/switch like stuff on the arduino board and as & when pressed, would it be possible for my android application to detect that press event?
Any help will be appreciated.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您阅读这些教程:
http://www.amarino-toolkit.net /index.php/tutorials.html
您不必先学习蓝牙编程。阿马里诺已经为您做了很多事情。
如果你想从 Arduino 收到一些东西。
在android部分,你只需
制作一个接收器并告诉你的android意图,连接到你的蓝牙模块,覆盖ArduinoReceiver类中的onReceive方法...
你放置的Arduino部分
要从Android接收事件并发送到Android...
我强烈推荐你完成这些教程。
I recommend you to read these tutorials:
http://www.amarino-toolkit.net/index.php/tutorials.html
You don't have to learn Bluetooth programming first. Amarino already done many things for you.
If you wanna receive something from Arduino.
In android part you just
Make a receiver and tell your android intent, Connect to your bluetooth module, override the onReceive method in ArduinoReceiver class...
Arduino part you put
To receive events from Android and send to Android...
I highly recommend you go through these tutorials.