Arduino sends incorrect data (Serial Link)

Hi, I have a little problem with serial link and Arduino Uno. I am trying to communicate by serial link with Flight Simulator, where I send a data about brakes to arduino (0,1) and simultaneously from arduino to simulator I send a string about state (brakes on/off). Here is part of my code:

   if (strValue == '1')
  {
      
      Serial.write("Parking break is on");
      digitalWrite(out1,HIGH);
      strValue = 'z';
           
  }

  if (strValue == '0')
  {
 
      Serial.write("Parking break is off");
      digitalWrite(out1,LOW);
      strValue = 'z';
      
  }

Problem is that LED is lighting up correctly, but string is not. When the brakes are on, my script in simulator writes out that are off and when is on, it writes off. I think that problem is somewhere in this code, but I don't know where. Could someone help me? Thank you in advance :slight_smile:

If I was to guess, I would think the LED anode is connected to 5v through a resistor, and the cathode is connected to the out1 pin. The LED would light when out1 is LOW. Just a guess...

Thank you for your reply. I use now the led which is integrated on arduino (pin 13) so the problem will be somwehere else. From sim I get 0 when it is off and 1 when it is on, and as I said, the led lights correctly, when brakes are active led is on, only string is not. Thank you once more.