Serial communication with two arduinos

Hi all, I got a arduino mega and a arduino nano. Connecting TX from one board to RX on other will make me able of serial communication? And do I need to connect the grounds?

Yes: Rx to Tx, Tx to Rx, Gnd to Gnd.

And then just using Serial.read() and Serial.write() will do it right?

Yes. Don't read more than Serial.available() shows is ready.

Ok, thanks for the quick answer.

No problem.

Just another question: What is the best way to read, store and send the data? Save it at a character array and after read it all, send it?
The idea (for now, to get something very non specific) is to write text at the serial in COM20 and receive it (then display it on Serial from COM21 and at a LCD display). I'm not sure what is the best way to do such a thing. I'm thinking on creating something like this to save the data: http://forum.arduino.cc/index.php/topic,45629.0.html

I wrote a demo illustrating communication between a PC and an Arduino in this Thread. The principles could be applied to your project - probably just by using the Arduino code on two devices with a few changes.

...R

This sketch: http://www.hackster.io/rayburne/the-qbf-signal-generator is capable of Arduino to Arduino & local loopback.

Ray

I will try it when I got some spare time. I will post the results when done. Thanks Robin2 and mrburnette.