Hi everyone, I currently learning how to do Serial communication between two Arduino Uno board, I currently find some useful resources online and I immediately tried it out on my Arduino boards. I connect the cables between the Rx ---> TX correctly
( RX --- TX, TX----RX, like a cross).
The code is here:
//This is the sender
void setup()
{
Serial.begin(9600); // set up Serial library at 9600 bps
}
void loop()
{
Serial.println("This is a test ");
delay(1000);
}
//This is the receiver
void setup()
{
Serial.begin(9600); // set up Serial library at 9600 bps
}
void loop()
{
char recievedChar;
if (Serial.available()){
recievedChar = Serial.read();
Serial.print(recievedChar);
}
The problem is I found out if I didn't connect the the one ground pin from one Arduino to another ground pin on the second Arduino, the Serial transfer will not start. Can somebody explain to me how come I have to connect the ground pins together to make it works ? Because I am try to build a wireless remote control project after I learn this and I don't want a cable linking between the ground pins.