hi all…
i have a problem about rs232 serial communication.I connect my device to Arduino Nano on the following pin
RS232 RX ---- in MAX232 out ------ TX ARDUINO
RS232 TX ---- in MAX232 out ------ RX ARDUINO
my device baudrate 9600 8N1.
arduino baudrate 9600 8N1.
I send decimal data from my device to arduino
85 83 44 71 83 44 32 32 32 45 48 46 55 53 44 107 103 13 10
but I don’t receive data like that. i recived a strange data.
44 32 32 85 83 44 71 32 32 45 48 46 55 53 44 107 103 13 10
45 48 46 55 53 44 107 103 13 10 44 32 32 85 83 44 71 53 44
107 103 13 10 44 32 32 85 32 85 83 44 71 32 32 45 48 46 10
13 10 44 32 32 85 83 44 45 48 46 55 53 44 107 48 46 55 53
and then I raise the baud rate to 115200
and i receive data
85 83 44 71 255 83 44 32 32 32 45 48 46 55 53 44 255 107 103 13 10
85 83 44 71 83 44 255 32 32 32 45 48 46 55 255 53 44 107 103 13 10
85 83 44 71 83 44 32 255 32 32 45 48 46 55 53 44 107 103 255 13 10
85 83 44 71 83 44 32 32 32 45 48 255 46 55 53 44 107 255 103 13 10
i get a normal value but there is value 255 from my data
how i fix that.
this my code :
#include <SoftwareSerial.h>
SoftwareSerial in(2,3);byte input [13]={};
void setup() {
in.begin(115200);
Serial.begin(9600);
}void loop()
{
if (in.available())
{
for(int i=0;i<12;i++)
{byte inchar = in.read();
input*=inchar;*
_ Serial.print(input*);_
_ }_
_ Serial.println("-");_
_}_
_}_
_[/quote]*_
i need to help thank you very much
terima kasih