我正在使用 HM-10 复制 CC4A-1 模块。经过一番挣扎后,我将它与 Arduino Uno R3 连接起来。我使用 Arduino 串行监视器执行了一些 AT 命令,它在执行 AT+RENEW 命令后突然停止工作。我也尝试执行 AT+BAUD command but it returned error before executing AT+RENEW.
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(2, 3); //RX|TX
void setup(){
Serial.begin(9600);
BTSerial.begin(9600); // default baud rate
while(!Serial); //if it is an Arduino Micro
Serial.println("AT commands: ");
}
void loop(){
//read from the HM-10 and print in the Serial
if(BTSerial.available())
Serial.write(BTSerial.read());
//read from the Serial and print to the HM-10
if(Serial.available())
BTSerial.write(Serial.read());
}