Hi I am a newbie.
I have a HM10 module using HMsoft V551 firmware, sending the AT command respectively, it can return complete message but I write a program to send ATcommand automatically and it always cut the string.
How should I modify my code? Thanks.
#include <SoftwareSerial.h>
//SoftwareSerial HM10(8, 7); // RX, TXvoid setup() {
HM10.begin(9600);
Serial.begin(9600);
sendCommand("AT+VERR?");
sendCommand("AT");
sendCommand("AT+ROLE1");
sendCommand("AT+IMME1");
sendCommand("AT+SHOW1");
sendCommand("AT+RESET");
sendCommand("AT+DISI?");
}void loop() {
sendCommand("AT+DISI?");
delay(1000);
}void sendCommand(String command){
Serial.print("Command send :");
Serial.println(command);
HM10.print(command);
//wait some time
delay(100);
char reply[100];
int i = 0;
while (HM10.available()) {
reply = HM10.read();
- i++;*
- }*
- //end the string*
_ reply = '\0';_
* Serial.println(reply);*
_ Serial.println("/*************/");_
_ delay(1000);_
_}_
_[/quote]_