简体   繁体   English

如何在 Android 和 Arduino mega2560 之间建立连接

[英]How to make a connection between Android and Arduino mega2560

I have an Arduino mega2560 which has a WiFi connection.我有一个带有 WiFi 连接的 Arduino mega2560。 I want to add a button to the Arduino so whenever someone clicks on it (physically), it sends a notification to my Android app (which I am building now).我想向 Arduino 添加一个按钮,因此每当有人点击它时(物理上),它都会向我的 Android 应用程序(我现在正在构建)发送通知。

I have tried to look for a way to do it and I understand now that I need to build a server.我试图寻找一种方法来做到这一点,现在我明白我需要构建一个服务器。 I have zero knowledge with servers.我对服务器的了解为零。 How can I start with this?我该如何开始? am I in the right way?我是在正确的方式吗? do I really need a server?我真的需要一台服务器吗? where can I start?我可以从哪里开始?

As you are probably using a serial module you can just use the arduino wifi library.由于您可能正在使用串行模块,因此您可以使用 arduino wifi 库。 Here is how to make a wifi webserver https://www.arduino.cc/en/Tutorial/WiFiWebServer ... for the button you just have to use a typical digitalread of the input pin.以下是如何制作 wifi 网络服务器https://www.arduino.cc/en/Tutorial/WiFiWebServer ... 对于按钮,您只需使用输入引脚的典型数字读取。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM