1
这是我的问题。我有一台Arduino Mega 2560与我的电脑上的USB连接(Windows 7)。在Arduino上,我连接了蓝牙设备HC-06。我将以下程序上传到我的arduino:发送数据从腻子蓝牙HC-6连接在Arduino
#include <SoftwareSerial.h>// import the serial library
SoftwareSerial Genotronex(14, 15); // RX, TX
int BluetoothData; // the data given from Computer
void setup() {
// put your setup code here, to run once:
Genotronex.begin(9600);
}
void loop() {
BluetoothData=Genotronex.read(); //read incoming data
Genotronex.println(BluetoothData); //print data received from bluetooth
delay(100);// prepare for next data ...
}
我成功地将我的arduino连接到蓝牙。接下来,我使用腻子并连接到蓝牙,但问题是它打印“-1”,这意味着到蓝牙的传入数据是“-1”,但我不会从任何其他程序发送任何数据。我也尝试从腻子中发送其他数据,但没有奏效。感谢和抱歉我的英语。
后在搜索一个网站,说我的TXD和RXD,以便接收数据连接上的Arduino的的10个11引脚的蓝牙我无心的日子。我不知道为什么它不能工作。 – user3354185