user80456: I have a hm-10 module attached to Arduino Leonardo board, I'm using a bluetooth terminal app to send some text.
The problem is I can send data from the Serial monitor to my phone but when I send from my phone, there is no output in the serial monitor.
It works fine if I test it on Arduino Uno.
I'm struggling with something that should be simple.
Can someone please help me?
Here is my code:-
#include <SoftwareSerial.h> 

SoftwareSerial BTSerial(4, 5); 

void setup(){
  Serial.begin(115200);            
  Serial.println("Hello!");      
  BTSerial.begin(115200);
}

void loop(){
  while (BTSerial.available()){ 
    byte data = BTSerial.read();
    Serial.write(data);
  }  

  while (Serial.available()){
    byte data = Serial.read();
    BTSerial.write(data); 
  }
}


user80456: I GOT IT!! It was problem with the pin settings.
According to SoftwareSerial library documentation, only pins 8,9,10,11,14,15,16 can be used for RX pin. But i used pin 4 for RX.

80456: <p>I have a hm-10 module attached to Arduino Leonardo board, I'm using a bluetooth terminal app to send some text.</p>
<p>The problem is I can send data from the Serial monitor to my phone but when I send from my phone, there is no output in the serial monitor.</p>
<p>It works fine if I test it on Arduino Uno.
I'm struggling with something that should be simple.</p>
<p>Can someone please help me?</p>
<p>Here is my code:-</p>
<pre><code>#include &lt;SoftwareSerial.h&gt; 

SoftwareSerial BTSerial(4, 5); 

void setup(){
  Serial.begin(115200);            
  Serial.println(&quot;Hello!&quot;);      
  BTSerial.begin(115200);
}

void loop(){
  while (BTSerial.available()){ 
    byte data = BTSerial.read();
    Serial.write(data);
  }  

  while (Serial.available()){
    byte data = Serial.read();
    BTSerial.write(data); 
  }
}
</code></pre>
 80456: <p>I GOT IT!! It was problem with the pin settings.</p>
<p>According to SoftwareSerial library documentation, only pins 8,9,10,11,14,15,16 can be used for RX pin. But i used pin 4 for RX.</p>
