Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bluetooth 使用带有HC-05的Arduino Leonardo将字符串发送到带有HC-05的PC_Bluetooth_Arduino - Fatal编程技术网

Bluetooth 使用带有HC-05的Arduino Leonardo将字符串发送到带有HC-05的PC

Bluetooth 使用带有HC-05的Arduino Leonardo将字符串发送到带有HC-05的PC,bluetooth,arduino,Bluetooth,Arduino,我目前正致力于使计算机和arduino板与每个板上的蓝牙模块hc-05进行通信 但是,我的程序可以在arduino IDE的串行监视器上显示正在计时的字符串。但是,当我拔下为arduino板供电的USB电缆并用9V电池更换时,板上的Tx LED一直亮着,当我打开tera term tuning至正确的波特率时,什么也没有显示 这是我用来复制的arduino代码 我对Arduino真的很陌生,才开始一周。我真心希望你们能提供帮助。谢谢。在Leonardo上,蓝牙应该使用Serial1,而不是Ser

我目前正致力于使计算机和arduino板与每个板上的蓝牙模块hc-05进行通信

但是,我的程序可以在arduino IDE的串行监视器上显示正在计时的字符串。但是,当我拔下为arduino板供电的USB电缆并用9V电池更换时,板上的Tx LED一直亮着,当我打开tera term tuning至正确的波特率时,什么也没有显示

这是我用来复制的arduino代码


我对Arduino真的很陌生,才开始一周。我真心希望你们能提供帮助。谢谢。

在Leonardo上,蓝牙应该使用Serial1,而不是Serial。序列号仅用于莱昂纳多的USB接口

int counter =0;

void setup() {
  Serial.begin(9600); 
  delay(50);
}

void loop() {
  counter++;
  Serial.print("Arduino counter: ");
  Serial.println(counter);
  delay(500); // wait half a sec
}