【发布时间】:2018-05-10 03:52:29
【问题描述】:
Arduino 接收数据没有问题,但是当我通过蓝牙从 arduino 接收 android 数据时,会出现奇怪的字符,例如 .下面是接收数据的方法代码:
private String convertInputToString() throws IOException {
DataInputStream is = new DataInputStream(btSocket.getInputStream());
char c;
String s = "";
do {
c = (char) is.read();
s += c + "";
} while (c != '\n');
return s;
}
我使用 Serial.println 传输 arduino 数据
我使用 Arduino Uno 和 Bluetoot HC-06
【问题讨论】:
标签: java android bluetooth arduino