I am trying to establish a communication between two arduinos using usart and software
serial interface.
the proteus schematic is attached.
master code is
#include<SoftwareSerial.h>
SoftwareSerial mySerial(10,11);
void setup(){
Serial.begin(9600);
mySerial.begin(9600);
mySerial.println("enter a char");
}
void loop(){
Serial.print('a');
}
and slave code is
#include<SoftwareSerial.h>
SoftwareSerial mySerial(10,11);
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
}
void loop()
{
if(Serial.available())
{
mySerial.println(Serial.read());
}
}
i am getting the output for the the above codes..
But if i try to read from virtual terminal on master side and send it to the slave it wont work...
the code on master side is
#include<SoftwareSerial.h>
SoftwareSerial mySerial(10,11);
void setup(){
Serial.begin(9600);
mySerial.begin(9600);
}
void loop(){
mySerial.println("enter a char");
while(!mySerial.available())
{
//wait until user enters the data
}
if(mySerial.available())
{
Serial.print(mySerial.read());
}
}
What i am doing wrong?