user20326: This is my code. I am tring to make a connection to my wifi through esp8266.
#define DST_IP "192.168.1.5" // my IP
#include <SoftwareSerial.h>

SoftwareSerial mySerial(0, 1);

void setup()
{
  Serial.begin(115200);
  mySerial.begin(115200);
  while (! Serial); // Wait until Serial is ready - Leonardo
  Serial.println("AT+RST");
  delay(4000);
  Serial.println("AT+CWJAP=\"Ahmed\",\"12341234Aass\"");
  delay(4000);
  if (Serial.find("OK") )
  {
    Serial.println("1");
  }
  else
  {
    Serial.println("0");
  }
}

void loop()
{

}

This is the result of my code.


user19513: SoftwareSerial mySerial(0, 1);

try changing pin0 and pin1 with some other pins. (lets say with pin2 & pin3)
pin0 and pin1 are used by default Serial.

20326: <p>This is my code. I am tring to make a connection to my wifi through esp8266.</p>

<pre><code>#define DST_IP "192.168.1.5" // my IP
#include &lt;SoftwareSerial.h&gt;

SoftwareSerial mySerial(0, 1);

void setup()
{
  Serial.begin(115200);
  mySerial.begin(115200);
  while (! Serial); // Wait until Serial is ready - Leonardo
  Serial.println("AT+RST");
  delay(4000);
  Serial.println("AT+CWJAP=\"Ahmed\",\"12341234Aass\"");
  delay(4000);
  if (Serial.find("OK") )
  {
    Serial.println("1");
  }
  else
  {
    Serial.println("0");
  }
}

void loop()
{

}
</code></pre>

<p>This is the result of my code.</p>

<p><a href="https://i.stack.imgur.com/rrJhu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rrJhu.png" alt="enter image description here"></a></p>
 19513: <pre><code>SoftwareSerial mySerial(0, 1);
</code></pre>

<p>try changing <strong>pin0</strong> and <strong>pin1</strong> with some other pins. (lets say with <strong>pin2</strong> &amp; <strong>pin3</strong>)</p>

<p><strong>pin0</strong> and <strong>pin1</strong> are used by default <strong>Serial</strong>.</p>
