Serial Problem

I can't get the Wire Library to run on my Arduino nanos. I've connected Rx to TX (twice) ,Ground to ground and 5V to 5V. So both are powered from an USB cable in one of them. But it's not woking...
Hope sb can give me a quick fix.

ComTestSlave.ino (228 Bytes)

ComTestMaster.ino (159 Bytes)

I can't get the Wire Library to run on my Arduino nanos. I've connected Rx to TX

Wire Library is for i2c communications, and the connections are between SDA/SCl( A4/A5) on the Nano.

Oh im stupid so communication between 2 Arduinos is done via i2c?

Wired, for communication between two Nano's you can use Software Serial, i2c, or SPI. What you use will depend on what you are trying to achieve, what other devices are on the bus, and what you are most familiar with using. Each method has its advantages and disadvantages. Nick Gammon has excedllent i2c and spi tutorials.