probleme in sending / receiving data RX/TX between two arduino

Hello everybody
I'm new using arduino and im pretty motivated .
I have probleme sending data and receiving it between arduino Uno and arduino Nano
i Use PROTEUS isis ; i use the tempature sensor LM35 !!
I had no problem displaying the temperature in the virtual terminale but my probleme is how to send this information from the first arduino with the Tx/RX serial module, and How to receive it from the other side and display it on LCD .

This is the code , would you please correct it to me ?

this is the receiver code ( nano ) : #include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int Temperature;

void setup() {

Serial.begin(9600);
lcd.begin(16, 2);
lcd.print("Wainting for data");
delay(2000);
lcd.clear();

}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {

Temperature=Serial.read();{
lcd.setCursor(0, 1);
lcd.print(Temperature);
}
}
}

===============================================================

This is the sender code

#define TempPin A0
int TempValue;
void setup()
{
Serial.begin(9600); // Initializing Serial Port
}

void loop()
{
TempValue = analogRead(TempPin); // Getting LM35 value and saving it in variable
int TempCe = ( TempValue/1024.0)500; // Getting the celsius value from 10 bit analog value
float TempFarh = (TempCe
9)/5 + 32; // Converting Celsius into Fahrenhiet

Serial.print("TEMPERATURE in Celsius = "); //Displaying temperature in Celsius
Serial.print(TempCe);
Serial.print("*C");
Serial.print(" | ");

Serial.print("TEMPRATURE = "); // Displaying Temperature in Fahrenheit
Serial.print(TempFarh);
Serial.print("*F");
Serial.println();

delay(1000);

{
if (Serial.available()) {
/* read the most recent byte */

/*ECHO the value that was read, back to the serial port. */
Serial.print(TempCe);
}
}
}

I had no problem displaying the temperature in the virtual terminale but my probleme is how to send this information from the first arduino with the Tx/RX serial module, and How to receive it from the other side and display it on LCD .

What is the problem? You don't appear to have connected the Arduino grounds together. You can't send data down a wire if there is not a complete circuit.

i conected it thanks ! but still no data displayed ! please check both of code and tell me if it's true , otherwise , please correct it to me .
it's my first time on arduino :smiley:

Please read the "how to post" message and edit your post to add code tags.

Temperature=Serial.read()This reads one character, not the temperature. You should study Serial Input Basics.

{
  if (Serial.available()) {
    /* read the most recent byte */
 
   
   
    /*ECHO the value that was read, back to the serial port. */
   Serial.print(TempCe);
  }
}

The outer curly braces are useless. Comments are not code.

Temperature=Serial.read();{
   lcd.setCursor(0, 1);
   lcd.print(Temperature);
        }

These curly braces are useless. Stomping every character in the same place is rather pointless.

Thank you paul ! Still dont know how to correct it

Please tell how to write the new code

i'm feeling my self lost lol

The first thing you need to do is get the two Arduinos connected using pins other than the hardware serial pins. Use SoftwareSerial on other pins. That lets you use the Serial instance/pins to talk to the PC, to debug your programs.

The second thing is to post a picture showing how the two Arduinos are actually connected. Three wires of the same color, 3 meters long, curled up, with the picture taken at an angle for 4 feet away in the dark, by someone shaking like a leaf won't cut it. Use short wires, of different colors. Take a picture in bright light from relatively close. Post the picture.

sorry but i'm still on the software part , did not achieve the hardware part !
I have to solve this problem on the soft part before going to hardware part !

Still not sure about what you told me because i think that the problem is on my code .

Please , some help on my code , and explain with more details ur reply back cause i'm a beginner in this field :slight_smile:

Thank u

I have probleme sending data and receiving it between arduino Uno and arduino Nano

For testing purposes, are you able to open an instance of the serial monitor for the uno and the nano at the same time?