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 ?
receiver :
#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);
}
}
}==============================================================================================
sender :
#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()) {
Serial.write(TempCe);
}
}
}