I use 485 modules to transmit data serially from one arduino uno to another uno.
If I connect the 2 arduino boards directly without using the rs485 module, the data is sent and received without a problem. But when using the rs485 module, the transmission stops.
Tx code:
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.write(200);
Serial.flush();
delay(50);
}
Rx code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available()) { // If data has come in from Master
int reply= Serial.read(); // Read the byte
delay(10);
lcd.print(reply);
}
}
I can't see what is the problem. I checked every thing wiring and the code is so simple. I'm just sending one number 200 and want to display it on the rx.
Please help. If anyone has an idea about this problem thanks any way.