<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">首先是Android的,个人觉得最好的源代码是https://github.com/plastygrove/BlueSerial</span>
其次是Arduino上,连接就不用说了。用的是HC06的蓝牙模块。
蓝牙的Rx接Arduino的Tx
蓝牙的Tx接Arduino的Rx
刚好是反过来的。
#include<SoftwareSerial.h> SoftwareSerial bluetooth(2,3);//rx,tx char val; int ledpin=13; void setup() { bluetooth.begin(9600); pinMode(ledpin,OUTPUT); } void loop() { if<