如何使用蓝牙从arduino接收串行数据?

时间:2019-11-23 15:41:00

标签: android arduino bluetooth

我是Arduino的新手,它具有0知识,这也是我第一次使用蓝牙进行编码,因此我想问一下如何实际从arduino接收串行数据,并在我的android中更改textview:< / p>

this

我想从arduino获取此值并在我的android中更改textview。因此它类似于if (xxx == "11"){ textview.setBackgroundColor(Color.RED);},但我不知道如何编写/如何获取arduino值并在android中声明。

1 个答案:

答案 0 :(得分:1)

例如,您将需要HC-05蓝牙模块以及串行库的使用。 尝试定义一个新的串行端口,然后通过它发送数据。 Arduino代码:

SoftwareSerial btSerial (12, 13); //TX sur 12 et RX sur 13
btSerial.begin(9600);
btSerial.println("Link Started !");