Codes sent to RS232 device:
0x55,0xAA,0x01,0x00,0x00,0x00,0x00,0x01,0x00
I expect the RS232 device to respond:
55 AA 01 00 00 00 25 00 01 00 01 00 5E 00 5E 00 00 00 00 00 00 00 22 00 22 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 49
The arduino program I used:
- CODE: SELECT_ALL_CODE
#include <SoftwareSerial.h>
int i = 0;
int x = 1 ;
byte GetData[] = {0x55,0xAA,0x01,0x00,0x00,0x00,0x00,0x01,0x00};
void setup() {
Serial.begin(9600);
}
void loop()
{
if(x>0){
for (int i=0; i<sizeof(GetData); i++){
Serial.write(GetData[i]);
}
x=x-1;
}
if (Serial.available()) {
Serial.println("data");
while(Serial.available()>0) {
byte inByte = Serial.read();
//Serial.print(inByte);
delay(10);
}}
}
The arduino serial monitor is blank.
Please help. Is there some bugs in my arduino program, or I have wrong configuration.
Thank you.