Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

problem with receiving data on arduino Serial port

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);

  }
}

` TERMINAl OUTPUT Arduio Serial Monitor output

Comments