[英]Arduino Sends Junk value to Android App (App Inventor 2) via Bluetooth
I just used an arduino code to send text data to an android application which I made in app inventor. 我只是使用arduino代码将文本数据发送到我在app inventor中制作的android应用程序。 I used Bluetooth module HC-05 for connectivity.It almost works but instead of sending few characters, it sends junk data.
我使用蓝牙模块HC-05进行连接,它几乎可以正常工作,但发送的不是垃圾字符,而是发送垃圾数据。 Here's the arduino code:
这是arduino代码:
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println("h");
delay(500);
Serial.println("s");
delay(500);
Serial.println("o");
delay(500);
}
And here's the App blocks and Design: 这是应用程序块和设计:
And here's the screenshot when I ran the app: 这是我运行该应用程序时的屏幕截图:
I click "Show" and I get these random junk data. 我单击“显示”,然后得到这些随机的垃圾数据。 And the next time I click show, I don't get any data at all.
下次单击“显示”时,我什么都没有。 Can anybody explain how to solve this ?
有人可以解释如何解决这个问题吗?
For Junk values, Try to change the baud rate! 对于垃圾值,请尝试更改波特率!
I think you are sending a data from BT device to android device only one time. 我认为您仅一次将数据从BT设备发送到android设备。 try running the code continuously in arduino device.
尝试在arduino设备中连续运行代码。
while(1){ loop(); }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.