Communication between Arduino and Light Meter

Hi,

Normally I would do:

byte msg1[] = {0xAA, 0x01, 0x42, 0x43, 0xA8};  //msg1 = hex AA, 01, 42, 43, A8

mySerial.write(msg1, sizeof(msg1));  //send msg1 to the RS232 device

String s="";
while (mySerial.available()>0) {    //receive and store response as string s 
  char c=mySerial.read();
  if (c != '\n') {           //if not LF (linefeed)
    s=s+c;
  } else {
    Serial.println(s);
  }
}

You shouldn't send the message as string type, use byte type.

Hope it helps.

Bronson
www.pt-altraman.com