title: Unable to do Arduino Mega to Arduino Mega serial communication
body: <p>Based on the circuit below, I tried hooking up two <strong>Arduino Mega</strong> for serial communication.</p>
  
  <p><a href="https://i.stack.imgur.com/6Cjay.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Cjay.png" alt="enter image description here"></a></p>
  
  <p>The code for sender:</p>
  
  
  
  <pre class="lang-cpp prettyprint-override"><code>char mystr[3] = "Hello"; //String data
  
  void setup() {
    // Begin the Serial at 9600 Baud
    Serial.begin(9600);
  }
  
  void loop() {
    Serial.write(mystr, 5); //Write the serial data
    delay(1000);
  }
  </code></pre>
  
  <p>The code for receiver:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>char mystr[5]; //Initialized variable to store received data
  
  void setup() {
    // Begin the Serial at 9600 Baud
    Serial.begin(9600);
  }
  
  void loop() {
    Serial.readBytes(mystr, 5); //Read the serial data and store in var
    delay(1000);
  }
  </code></pre>
  
  <p>There is no output in the Serial console of Arduino. Could someone please inform me of the possible cause and solution for the same. If I've missed out anything, over- or under-emphasized a specific point let me know in the comments.</p>