Hi,
I need to use HM-10 with Arduino Uno or Nano.
I'm not able to figure out how to send AT commands and read the reply.
Here's what I've tried so far:
#include <SoftwareSerial.h>
SoftwareSerial blueToothSerial(0,1); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);
Serial.println("Serial began");
blueToothSerial.begin(9600);
delay(2000);
}
void loop()
{
Serial.println("looping...");
blueToothSerial.print("AT+DISC?");
delay(5000);
if (blueToothSerial.available())
{
Serial.println("bluetooth serial available");
Serial.write(blueToothSerial.read());
}
if (Serial.available())
blueToothSerial.write(Serial.read());
}
However, I'm not able to read any reply, I feel the command is not firing. The execution doesnt go inside if(blueToothSerial.available())