I have a device connected to to an arduino nano through RS232. When i Connect the same device to a COM terminal on the PC, it displays correct values. But when i try to read it on arduino serial port it displays some garbage. `
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
void setup() {
mySerial.begin(1200);
Serial.begin(9600);
Serial.print("test");
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
}
void loop()
{
if (mySerial.available()) {
delay(100);
byte a=mySerial.read();
Serial.println(a);
}
}
Comments
Post a Comment