Arduino -> MAX232 -> LG-TV

Hi,
my LG-TV is able to receive RS-232 commands.
I would like to controll it with my Arduino Uno. To convert the Arduino TTL-Comands I've got a MAX232-IC.
As you can see in this manual beginning at page 27 there is documented how I have to connect each devices and what commands I have to use.

My problem is that the TV is not responding to my commands. For example I am trying to send via Serial Monitor a 1 so that the Arduino is sending a shutdown command to the TV. (I only wired up the Arduino-TX).

void setup() {
  Serial.begin(9600);
}

void loop() {
  if(Serial.read()='1'){
    Serial.write("ka 01 00\r");
  }
}

To see if the commands are send, I once connected another Arduino to receive the Commands and got "ka 01 00" without the Carriage Return. What am I doing wrong?

I think you are adding spaces wrong
Try this way:

void setup() {
  Serial.begin(9600);
}

void loop() {
  if(Serial.read()='1'){
    Serial.write('k');
    Serial.write('a');
    Serial.write(0x00);// shutdown command
    Serial.write(0x0D);

  }
}

Hi,
thank you for your answer. But i have to admit, that i made a mistake that night with the wiring. My code was correct. :kissing: :cold_sweat: