[SOLVED] SoftwareSerial simple message

Hi, i have two arduino connected to each other. Arduino one pin 10 RX to pin 11 TX on other arduino and vice versa. I have this simple "hi" message sending every second 1 second from arduino one to arduino two. But nothing is showing. Here are the two codes.

Sender:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()
{

  Serial.begin(9600);
  while (!Serial) {
    ;  
  }

  mySerial.begin(9600);

}

void loop() // run over and over
{
  mySerial.write("hi");
  delay (1000);

}

Receiver:


#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()
{

  Serial.begin(9600);
  while (!Serial) {
    ;
  }

  mySerial.begin(9600);

}

void loop() // run over and over
{
  if (mySerial.available())

    mySerial.println();

}

Did you connect the grounds?

What do you expect this to print?

PS: check out this

is this better?

#include <SoftwareSerial.h>


SoftwareSerial mySerial =  SoftwareSerial(10, 11);
char rd;

void setup()  {
Serial.begin(9600);

    mySerial.begin(9600);
    while (!mySerial)
    {
    ;
    }
}
void loop() {
    if (mySerial.available()) 
    {
        rd=mySerial.read();
        mySerial.print(rd);
    }
}

not at first, then i changed the code and still nothing

Where do you expect to see the output of this action to appear?

mySerial.print(rd);

I have the impression that you aren't very carefully thinking this through.

Take a look at this code, which echos the serial data obtained from a GPS module to the serial monitor:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); //GPS (RX, TX) check correct pin assignments and baud rate

void setup() {
  mySerial.begin(9600);
  Serial.begin(9600);
  Serial.println("GPS start");
}

void loop() {
  while (mySerial.available()) {
    Serial.write(mySerial.read());
  }
}

awesome! thanks