1

I've connected to RS232 device with arduino. When showing data in arduino its showing as:

235
157
191
157
159
153
157
0

While in Hyperterminal it's showing as:

 101 102 103 104

How to get the same data as hyperterminal in arduino too?

My Arduino code:

   if (RS232.available()) {
    int incomingByte = RS232.read();

    Serial.println(incomingByte);

    //Sending to bluetooth
    BTserial.println(incomingByte);
  }
  • The Arduino serial monitor is incredibly crude and barely usable at the best of times. It may be to do with line endings, or something similar. Personally I would use putty or teraterm rather than hyperterminal, since that is a bit crude too (though not as crude as the arduino serial monitor). – Majenko May 11 '17 at 16:03
  • @Majenko In my case, Hyperterminal is showing correct data as above. But serial should show similar data too. Is there any problem in my Arduino code? – Rahul Rastogi May 11 '17 at 16:50
  • Not in that little snippet, no. However the two serial programs do deal with line endings in a very different manner, which is probably where the difference in displays lies. – Majenko May 11 '17 at 16:56
  • What results do you get if you change `int incomingByte` to `char incomingByte` or to `byte incomingByte`? – James Waldby - jwpat7 May 11 '17 at 17:00
  • @JamesWaldby-jwpat7 on changing to "char incomingByte" special chars print, somewhat like square symbol. And on changing to "byte incomingByte" result remains the same. – Rahul Rastogi May 11 '17 at 17:51
  • 1
    Rahul Rastogi, by “result remains the same” do you mean the same as for "char incomingByte", or like the “int incomingByte” output? – James Waldby - jwpat7 May 11 '17 at 18:34

0 Answers0